pinctrl: samsung: Fix the pointer in PTR_ERR()
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 1 Jun 2015 12:57:04 +0000 (09:57 -0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 4 Jun 2015 08:14:35 +0000 (10:14 +0200)
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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/samsung/pinctrl-samsung.c

index ed165ba2eb2f187c550fd95c8767e6d4263961d2..0fd20c5ffde9951c9a8e00ba9786e7c82da3623a 100644 (file)
@@ -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;