mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
memory: ti-aemif: fix a potential NULL-pointer dereference
commit6b45a2b1c0upstream. Platform data pointer may be NULL. We check it everywhere but in one place. Fix it. Fixes:8af70cd2ca("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8bf0dc8d0a
commit
ce987db2b5
@@ -411,7 +411,7 @@ static int aemif_probe(struct platform_device *pdev)
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
} else if (pdata) {
|
||||
for (i = 0; i < pdata->num_sub_devices; i++) {
|
||||
pdata->sub_devices[i].dev.parent = dev;
|
||||
ret = platform_device_register(&pdata->sub_devices[i]);
|
||||
|
||||
Reference in New Issue
Block a user