[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180906121219.23948-1-brgl@bgdev.pl>
Date: Thu, 6 Sep 2018 14:12:19 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Santosh Shilimkar <ssantosh@...nel.org>,
Sekhar Nori <nsekhar@...com>,
Kevin Hilman <khilman@...nel.org>,
Dan Carpenter <dan.carpenter@...cle.com>
Cc: linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
stable@...r.kernel.org
Subject: [PATCH] memory: ti-aemif: fix a potential NULL-pointer dereference
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
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@...cle.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
Cc: stable@...r.kernel.org
---
drivers/memory/ti-aemif.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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]);
--
2.18.0
Powered by blists - more mailing lists