From patchwork Tue Jun 28 11:21:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 9202957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4D4F660757 for ; Tue, 28 Jun 2016 11:23:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E8C428412 for ; Tue, 28 Jun 2016 11:23:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3187A285F9; Tue, 28 Jun 2016 11:23:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id D6E0328412 for ; Tue, 28 Jun 2016 11:23:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bHr5r-0002Yo-FW; Tue, 28 Jun 2016 11:22:15 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bHr5o-0002W9-Lh for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2016 11:22:13 +0000 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9H031UXBKDSM30@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2016 20:21:49 +0900 (KST) X-AuditID: cbfee61b-f798b6d00000114d-a6-57725dcdb605 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 0F.7A.04429.DCD52775; Tue, 28 Jun 2016 04:21:49 -0700 (MST) Received: from AMDC1976.DIGITAL.local ([106.120.53.102]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O9H00K2YBK59LA0@mmp2.samsung.com>; Tue, 28 Jun 2016 20:21:49 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Chanwoo Choi Subject: [PATCH] PM / devfreq: exynos-ppmu: fix error path in exynos_ppmu_probe() Date: Tue, 28 Jun 2016 13:21:08 +0200 Message-id: <1467112869-30488-1-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjluLIzCtJLcpLzFFi42I5/e+xoO7Z2KJwg5ub9Cw2zljPanH9y3NW i9cvDC36H79mtjjb9IbdYtPja6wWl3fNYbP43HuE0WLG+X1MFrcbV7A5cHlsWtXJ5rF5Sb1H 35ZVjB6fN8kFsERx2aSk5mSWpRbp2yVwZRzdJV2wgK3i/aX7zA2M81i7GDk5JARMJG5Pmwhl i0lcuLeerYuRi0NIYBajxLud7SwQzi9GibUtP5hAqtgErCQmtq9iBLFFBDQkZv69wghSxCxw nEni47smoFEcHMICwRJf13uD1LAIqEqs3LAQrJdXwEPi//RTjBDb5CROHpvMOoGRewEjwypG idSC5ILipPRco7zUcr3ixNzi0rx0veT83E2M4NB5Jr2D8fAu90OMAhyMSjy8FyYXhguxJpYV V+YeYpTgYFYS4Q2PLgoX4k1JrKxKLcqPLyrNSS0+xCjNwaIkzvv4/7owIYH0xJLU7NTUgtQi mCwTB6dUAyOvRNje222ttZtXG8z6sbptr2LzllNGVxdM1kmYPNdiZs79wJ8JKS7a1wxi9zA4 rP322WNL6WaZL82NAqsED7SwTGnuvVnwfN7ilys093meDs0zzO4JP/teZkHCvwMF9vI7Wgxk +pZYLU488kn4fea3ia4Bsk0PPj+1TDPZUJ878e4VT4NL9/iUWIozEg21mIuKEwH1yDkmGQIA AA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160628_042212_852010_D221A43F X-CRM114-Status: GOOD ( 12.63 ) 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: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, b.zolnierkie@samsung.com, linux-kernel@vger.kernel.org, Kyungmin Park , MyungJoo Ham , Kukjin Kim , 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-Virus-Scanned: ClamAV using ClamSMTP iounmap() needs to be called in case of memory allocation (for devfreq-event devices) failure. Fix it. Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Chanwoo Choi --- drivers/devfreq/event/exynos-ppmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c index f312485..845bf25 100644 --- a/drivers/devfreq/event/exynos-ppmu.c +++ b/drivers/devfreq/event/exynos-ppmu.c @@ -482,7 +482,8 @@ static int exynos_ppmu_probe(struct platform_device *pdev) if (!info->edev) { dev_err(&pdev->dev, "failed to allocate memory devfreq-event devices\n"); - return -ENOMEM; + ret = -ENOMEM; + goto err; } edev = info->edev; platform_set_drvdata(pdev, info);