提交 6a40cbbe 编写于 作者: S Sachin Kamat 提交者: Mauro Carvalho Chehab

[media] exynos4-is: Fix potential NULL pointer dereference

dev->of_node could be NULL. Hence check for the same and return before
dereferencing it in the subsequent error message.
Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 3dbc9964
...@@ -1504,16 +1504,17 @@ static int fimc_lite_probe(struct platform_device *pdev) ...@@ -1504,16 +1504,17 @@ static int fimc_lite_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int ret; int ret;
if (!dev->of_node)
return -ENODEV;
fimc = devm_kzalloc(dev, sizeof(*fimc), GFP_KERNEL); fimc = devm_kzalloc(dev, sizeof(*fimc), GFP_KERNEL);
if (!fimc) if (!fimc)
return -ENOMEM; return -ENOMEM;
if (dev->of_node) { of_id = of_match_node(flite_of_match, dev->of_node);
of_id = of_match_node(flite_of_match, dev->of_node); if (of_id)
if (of_id) drv_data = (struct flite_drvdata *)of_id->data;
drv_data = (struct flite_drvdata *)of_id->data; fimc->index = of_alias_get_id(dev->of_node, "fimc-lite");
fimc->index = of_alias_get_id(dev->of_node, "fimc-lite");
}
if (!drv_data || fimc->index >= drv_data->num_instances || if (!drv_data || fimc->index >= drv_data->num_instances ||
fimc->index < 0) { fimc->index < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册