提交 9979c1c7 编写于 作者: V Vladimir Zapolskiy 提交者: Dmitry Torokhov

Input: snvs_pwrkey - fix returned value check of syscon_regmap_lookup_by_phandle()

On error syscon_regmap_lookup_by_phandle() returns ERR_PTR() value,
which makes a check for NULL invalid and may lead to oops on error
path.
Signed-off-by: NVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 62d5bdf9
......@@ -111,9 +111,9 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
return -ENOMEM;
pdata->snvs = syscon_regmap_lookup_by_phandle(np, "regmap");
if (!pdata->snvs) {
if (IS_ERR(pdata->snvs)) {
dev_err(&pdev->dev, "Can't get snvs syscon\n");
return -ENODEV;
return PTR_ERR(pdata->snvs);
}
if (of_property_read_u32(np, "linux,keycode", &pdata->keycode)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册