From: Robert Jarzmik Date: Sat, 12 Dec 2015 21:43:05 +0000 (+0100) Subject: pinctrl: pxa: pxa2xx: add pin control skeleton X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e670b29815f301e47e81d42006c80be6b7aff01d;p=linux-beck.git pinctrl: pxa: pxa2xx: add pin control skeleton 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 Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pxa/pinctrl-pxa2xx.c b/drivers/pinctrl/pxa/pinctrl-pxa2xx.c index e01914460219..d90e205cf809 100644 --- a/drivers/pinctrl/pxa/pinctrl-pxa2xx.c +++ b/drivers/pinctrl/pxa/pinctrl-pxa2xx.c @@ -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; }