[PATCH] Input: fix odd_ptr_err.cocci warnings

kernel test robot
2022-04-07T00:10:36Z

From: kernel test robot <lkp@intel.com>

drivers/input/misc/isa1200.c:327:5-11: inconsistent IS_ERR and PTR_ERR on line 328.
drivers/input/misc/isa1200.c:332:5-11: inconsistent IS_ERR and PTR_ERR on line 333.

PTR_ERR should access the value just tested by IS_ERR

Semantic patch information:
There can be false positives in the patch case, where it is the call to
IS_ERR that is wrong.

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git ux500-janice-v5.18-rc1
head: 7d27ddbe075c07508ab045a63d23aeca798514ee
commit: 0baaba96c1a1116b9fc698a263657cb9b6ab8198 [18/21] Input: isa1200 - new driver for Immersion ISA1200
:::::: branch date: 27 hours ago
:::::: commit date: 29 hours ago

drivers/input/misc/isa1200.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/input/misc/isa1200.c
+++ b/drivers/input/misc/isa1200.c
@@ -325,12 +325,12 @@ static int isa1200_probe(struct i2c_clie

isa->hen = devm_gpiod_get(dev, "hen", GPIOD_OUT_LOW);
if (IS_ERR(isa->hen)) {
- ret = PTR_ERR(isa->map);
+ ret = PTR_ERR(isa->hen);
return dev_err_probe(dev, ret, "failed to get HEN GPIO\n");
}
isa->len = devm_gpiod_get(dev, "len", GPIOD_OUT_LOW);
if (IS_ERR(isa->hen)) {
- ret = PTR_ERR(isa->map);
+ ret = PTR_ERR(isa->hen);
return dev_err_probe(dev, ret, "failed to get LEN GPIO\n");
}

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org