From: kbuild test robot <fengguang.wu@xxxxxxxxx> 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@xxxxxxxxx> Signed-off-by: Julia Lawall <julia.lawall@xxxxxxx> --- 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(-) --- 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);