diff options
author | Krzysztof Kozlowski <k.kozlowski.k@gmail.com> | 2015-07-09 13:19:53 (GMT) |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-07-17 07:48:00 (GMT) |
commit | 015403145a65f0a0f7c4d9badfb12759349d1e13 (patch) | |
tree | 6e9e3abac1c869c9e15b12af0bac4237eff28328 /drivers/gpio | |
parent | 72858602e167ea2d7487337bac279beec7a99c84 (diff) | |
download | linux-015403145a65f0a0f7c4d9badfb12759349d1e13.tar.xz |
gpio: etraxfs: Fix devm_ioremap_resource return value check
Value returned by devm_ioremap_resource() was checked for non-NULL but
devm_ioremap_resource() returns IOMEM_ERR_PTR, not NULL. In case of
error this could lead to dereference of ERR_PTR.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-etraxfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-etraxfs.c b/drivers/gpio/gpio-etraxfs.c index 28071f4..0e64314 100644 --- a/drivers/gpio/gpio-etraxfs.c +++ b/drivers/gpio/gpio-etraxfs.c @@ -117,8 +117,8 @@ static int etraxfs_gpio_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = devm_ioremap_resource(dev, res); - if (!regs) - return -ENOMEM; + if (IS_ERR(regs)) + return PTR_ERR(regs); match = of_match_node(etraxfs_gpio_of_table, dev->of_node); if (!match) |