summaryrefslogtreecommitdiffstats
path: root/drivers/memory
diff options
context:
space:
mode:
authorBartosz Golaszewski <bgolaszewski@baylibre.com>2018-09-06 14:12:19 +0200
committerOlof Johansson <olof@lixom.net>2018-09-06 10:04:07 -0700
commit6b45a2b1c0bc2aec84d1c56a1976ca9c8a621ecb (patch)
tree4cc5ddeb9fb336871df3b188d5a65d186aa04184 /drivers/memory
parente312b6dcbb633bc87414f1143e0015adbbf87ae0 (diff)
downloadlinux-stable-6b45a2b1c0bc2aec84d1c56a1976ca9c8a621ecb.tar.gz
linux-stable-6b45a2b1c0bc2aec84d1c56a1976ca9c8a621ecb.tar.bz2
linux-stable-6b45a2b1c0bc2aec84d1c56a1976ca9c8a621ecb.zip
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: 8af70cd2ca50 ("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>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/ti-aemif.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/memory/ti-aemif.c b/drivers/memory/ti-aemif.c
index 31112f622b88..475e5b3790ed 100644
--- a/drivers/memory/ti-aemif.c
+++ b/drivers/memory/ti-aemif.c
@@ -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]);