Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b45a2b1 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Olof Johansson
Browse files

memory: ti-aemif: fix a potential NULL-pointer dereference



Platform data pointer may be NULL. We check it everywhere but in one
place. Fix it.

Fixes: 8af70cd2 ("memory: aemif: add support for board files")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parent e312b6dc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -411,7 +411,7 @@ static int aemif_probe(struct platform_device *pdev)
			if (ret < 0)
			if (ret < 0)
				goto error;
				goto error;
		}
		}
	} else {
	} else if (pdata) {
		for (i = 0; i < pdata->num_sub_devices; i++) {
		for (i = 0; i < pdata->num_sub_devices; i++) {
			pdata->sub_devices[i].dev.parent = dev;
			pdata->sub_devices[i].dev.parent = dev;
			ret = platform_device_register(&pdata->sub_devices[i]);
			ret = platform_device_register(&pdata->sub_devices[i]);