提交 6ecd36d7 编写于 作者: P Pan Bian 提交者: Dmitry Torokhov

Input: mxs-lradc - use correct error check

Function devm_ioremap() will return a NULL pointer on failure. However,
in function mxs_lradc_ts_probe(), its return value is checked with
IS_ERR(), which cannot detect the exceptional case.
Signed-off-by: NPan Bian <bianpan2016@163.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 e48060ce
......@@ -633,8 +633,8 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
if (!iores)
return -EINVAL;
ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
if (IS_ERR(ts->base))
return PTR_ERR(ts->base);
if (!ts->base)
return -ENOMEM;
ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
&ts_wires);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册