提交 6b45a2b1 编写于 作者: B Bartosz Golaszewski 提交者: Olof Johansson

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: 8af70cd2 ("memory: aemif: add support for board files")
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: stable@vger.kernel.org
Signed-off-by: NOlof Johansson <olof@lixom.net>
上级 e312b6dc
......@@ -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]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册