diff mbox

pinctrl: samsung: Fix the pointer in PTR_ERR()

Message ID 1433163424-6123-1-git-send-email-fabio.estevam@freescale.com
State New
Headers show

Commit Message

Fabio Estevam June 1, 2015, 12:57 p.m. UTC
PTR_ERR should access the value just tested by IS_ERR

The semantic patch that makes this change is available
in scripts/coccinelle/tests/odd_ptr_err.cocci.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij June 4, 2015, 8:15 a.m. UTC | #1
On Mon, Jun 1, 2015 at 2:57 PM, Fabio Estevam
<fabio.estevam@freescale.com> wrote:

> PTR_ERR should access the value just tested by IS_ERR
>
> The semantic patch that makes this change is available
> in scripts/coccinelle/tests/odd_ptr_err.cocci.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Oviously correct, patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index ed165ba..0fd20c5 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -806,7 +806,7 @@  static int samsung_pinctrl_parse_dt(struct platform_device *pdev,
 	functions = samsung_pinctrl_create_functions(dev, drvdata, &func_cnt);
 	if (IS_ERR(functions)) {
 		dev_err(dev, "failed to parse pin functions\n");
-		return PTR_ERR(groups);
+		return PTR_ERR(functions);
 	}
 
 	drvdata->pin_groups = groups;