pinctrl: pxa: pxa2xx: add pin control skeleton
authorRobert Jarzmik <robert.jarzmik@free.fr>
Sat, 12 Dec 2015 21:43:05 +0000 (22:43 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 15 Dec 2015 13:07:06 +0000 (14:07 +0100)
The wrong free functions were used to release temporary buffers.

This didn't show up in the normal driver's life. Yet in suspend to RAM,
the managed resource list is walked, and as memory was released, the
list is corrupted and make the kernel Oops.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pxa/pinctrl-pxa2xx.c

index e019144..d90e205 100644 (file)
@@ -292,7 +292,7 @@ static int pxa2xx_build_functions(struct pxa_pinctrl *pctl)
        if (!pctl->functions)
                return -ENOMEM;
 
-       kfree(functions);
+       devm_kfree(pctl->dev, functions);
        return 0;
 }
 
@@ -328,7 +328,7 @@ static int pxa2xx_build_groups(struct pxa_pinctrl *pctl)
                memcpy(func->groups, gtmp, ngroups * sizeof(*gtmp));
        }
 
-       kfree(gtmp);
+       devm_kfree(pctl->dev, gtmp);
        return 0;
 }