[PATCH] input: tm2-touchkey: fix odd_ptr_err.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




PTR_ERR should access the value just tested by IS_ERR

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

CC: Jaechul Lee <jcsing.lee@xxxxxxxxxxx>
Signed-off-by: Julia Lawall <julia.lawall@xxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---

I have only looked at the extract of code that is shown here.  It could be
the test that is wrong.

The code comes from:

url:
https://github.com/0day-ci/linux/commits/Jaechul-Lee/Add-touch-key-driver-su
pport-for-TM2/20170103-183357
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

 tm2-touchkey.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/input/keyboard/tm2-touchkey.c
+++ b/drivers/input/keyboard/tm2-touchkey.c
@@ -196,7 +196,7 @@ static int tm2_touchkey_probe(struct i2c
 				devm_regulator_get(&client->dev, "vdd");
 	if (IS_ERR(samsung_touchkey->regulator_vdd)) {
 		dev_err(&client->dev, "Failed to get vdd regulator\n");
-		return PTR_ERR(samsung_touchkey->regulator_vcc);
+		return PTR_ERR(samsung_touchkey->regulator_vdd);
 	}

 	/* power */
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux