Skip to content

Commit 6b45a2b

Browse files
brglolofj
authored andcommitted
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: 8af70cd ("memory: aemif: add support for board files") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: stable@vger.kernel.org Signed-off-by: Olof Johansson <olof@lixom.net>
1 parent e312b6d commit 6b45a2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/memory/ti-aemif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ static int aemif_probe(struct platform_device *pdev)
411411
if (ret < 0)
412412
goto error;
413413
}
414-
} else {
414+
} else if (pdata) {
415415
for (i = 0; i < pdata->num_sub_devices; i++) {
416416
pdata->sub_devices[i].dev.parent = dev;
417417
ret = platform_device_register(&pdata->sub_devices[i]);

0 commit comments

Comments
 (0)