From: Pan Bian Date: Mon, 14 Aug 2017 17:29:13 +0000 (-0700) Subject: Input: mxs-lradc - use correct error check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6ecd36d732886ecb07768432212efce9cfb6ac2f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Pan Bian Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c index 71bf493e8b58..816f5c8c101d 100644 --- a/drivers/input/touchscreen/mxs-lradc-ts.c +++ b/drivers/input/touchscreen/mxs-lradc-ts.c @@ -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);