diff mbox series

regulator: s5m8767: fix odd_ptr_err.cocci warnings

Message ID alpine.DEB.2.21.1811301741580.2369@hadrien
State New
Headers show
Series regulator: s5m8767: fix odd_ptr_err.cocci warnings | expand

Commit Message

Julia Lawall Nov. 30, 2018, 5:43 p.m. UTC
From: kbuild test robot <fengguang.wu@intel.com>

 PTR_ERR should access the value just tested by IS_ERR

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

Fixes: fbc2a5f2f68f ("regulator: s5m8767: Let core handle GPIO descriptors")
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

I have absolutely no idea whether this is a correct patch, since not much
context is shown.  I'm just forwarding it in case it is useful.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-regulator-fixup
head:   efc08549a219debb5c641739ca0f01af97fd0f64
commit: fbc2a5f2f68f0a0f8bdac6880849d9a112c29184 [10/11] regulator: s5m8767: Let core handle GPIO descriptors
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

Please take the patch only if it's a positive warning. Thanks!

 s5m8767.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -608,7 +608,7 @@  static int s5m8767_pmic_dt_parse_pdata(s
 			"s5m8767");
 		if (IS_ERR(gpiod)) {
 			devres_free(dr);
-			return PTR_ERR(rdata->ext_control_gpiod);
+			return PTR_ERR(gpiod);
 		}
 		*dr = gpiod;
 		devres_add(&pdev->dev, dr);