diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2017-08-14 10:26:27 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-08-14 20:23:46 -0700 |
commit | e48060ce2c7f73e424272bd6f5d9f996f1853064 (patch) | |
tree | dd37c9f0411f8dad577605cb1fb54c25a30c0bf4 /drivers/input/touchscreen/mxs-lradc-ts.c | |
parent | 94aef061c796d3d47f1a2eed41e651ffaaade402 (diff) | |
download | lwn-e48060ce2c7f73e424272bd6f5d9f996f1853064.tar.gz lwn-e48060ce2c7f73e424272bd6f5d9f996f1853064.zip |
Input: mxs-lradc - do a NULL check on iores
platform_get_resource() may fail, so we should better do a NULL check
and return error on failure.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/mxs-lradc-ts.c')
-rw-r--r-- | drivers/input/touchscreen/mxs-lradc-ts.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c index 58c016cd6809..71bf493e8b58 100644 --- a/drivers/input/touchscreen/mxs-lradc-ts.c +++ b/drivers/input/touchscreen/mxs-lradc-ts.c @@ -630,6 +630,8 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev) spin_lock_init(&ts->lock); iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!iores) + return -EINVAL; ts->base = devm_ioremap(dev, iores->start, resource_size(iores)); if (IS_ERR(ts->base)) return PTR_ERR(ts->base); |