diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2018-09-06 14:12:19 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-19 22:41:23 +0200 |
commit | ce987db2b52fd8ce551bb728f0a865dedff6fc83 (patch) | |
tree | a495f2ec78c619b29e2e58a29c19ff7205b22178 /drivers/memory | |
parent | 8bf0dc8d0a6732339e28add75970b907fd238c59 (diff) |
memory: ti-aemif: fix a potential NULL-pointer dereference
commit 6b45a2b1c0bc2aec84d1c56a1976ca9c8a621ecb upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/ti-aemif.c | 2 |
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]); |