提交 58a823dd 编写于 作者: S shailendra.v@samsung.com 提交者: Matthias Brugger

soc: mediatek: PMIC wrap: Fix possible NULL derefrence.

of_match_device could return NULL, and so can cause a NULL
pointer dereference later.
Signed-off-by: NShailendra Verma <shailendra.v@samsung.com>
Signed-off-by: NMatthias Brugger <matthias.bgg@gmail.com>
上级 f282693f
......@@ -1117,6 +1117,11 @@ static int pwrap_probe(struct platform_device *pdev)
const struct of_device_id *of_slave_id = NULL;
struct resource *res;
if (!of_id) {
dev_err(&pdev->dev, "Error: No device match found\n");
return -ENODEV;
}
if (pdev->dev.of_node->child)
of_slave_id = of_match_node(of_slave_match_tbl,
pdev->dev.of_node->child);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册