From patchwork Sat Dec 12 21:43:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 7837501 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A13059F39B for ; Sat, 12 Dec 2015 21:47:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF4DD20397 for ; Sat, 12 Dec 2015 21:47:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 096B420390 for ; Sat, 12 Dec 2015 21:47:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a7rxq-0004y0-Qu; Sat, 12 Dec 2015 21:44:26 +0000 Received: from smtp04.smtpout.orange.fr ([80.12.242.126] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a7rxn-0004wV-Fj for linux-arm-kernel@lists.infradead.org; Sat, 12 Dec 2015 21:44:24 +0000 Received: from belgarion.home ([92.156.1.80]) by mwinf5d59 with ME id sljv1r0071jaGLk03ljvqU; Sat, 12 Dec 2015 22:43:57 +0100 X-ME-Helo: belgarion.home X-ME-Date: Sat, 12 Dec 2015 22:43:57 +0100 X-ME-IP: 92.156.1.80 From: Robert Jarzmik To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Linus Walleij Subject: [PATCH] fixup! pinctrl: pxa: pxa2xx: add pin control skeleton Date: Sat, 12 Dec 2015 22:43:05 +0100 Message-Id: <1449956585-17118-1-git-send-email-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151212_134423_850317_10B6F73A X-CRM114-Status: GOOD ( 11.81 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Linus, if it's time, then this can fixup the commit. If not, I'll provide a better commit message. --- drivers/pinctrl/pxa/pinctrl-pxa2xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }