diff options
author | Geordan Neukum <gneukum1@gmail.com> | 2019-05-26 01:18:33 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-30 14:04:26 -0700 |
commit | e621c8a108ede08e6ff66524b4a4f756f66e5eeb (patch) | |
tree | 990151619485a28aa4c12c0506b954a75ec115e5 /drivers/staging/kpc2000 | |
parent | 4ff740315aee92ec19add0193cef976e532e34dc (diff) | |
download | linux-stable-e621c8a108ede08e6ff66524b4a4f756f66e5eeb.tar.gz linux-stable-e621c8a108ede08e6ff66524b4a4f756f66e5eeb.tar.bz2 linux-stable-e621c8a108ede08e6ff66524b4a4f756f66e5eeb.zip |
staging: kpc2000: kpc_i2c: fail probe if unable to map I/O space
The kpc2000 driver does not verify whether or not mapping the I/O
space succeeded during probe time. Make the driver verify that the
mapping operation was successful before potentially using that area
in the future.
Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/kpc2000')
-rw-r--r-- | drivers/staging/kpc2000/kpc2000_i2c.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c index 452052bf9476..51e91653e183 100644 --- a/drivers/staging/kpc2000/kpc2000_i2c.c +++ b/drivers/staging/kpc2000/kpc2000_i2c.c @@ -591,6 +591,8 @@ static int pi2c_probe(struct platform_device *pldev) return -ENXIO; priv->smba = (unsigned long)ioremap_nocache(res->start, resource_size(res)); + if (!priv->smba) + return -ENOMEM; platform_set_drvdata(pldev, priv); |