From patchwork Fri Jul 17 18:33:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 6820841 Return-Path: X-Original-To: patchwork-alsa-devel@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 86B8E9F536 for ; Sat, 18 Jul 2015 07:15:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B1E7B20834 for ; Sat, 18 Jul 2015 07:15:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EF0D820831 for ; Sat, 18 Jul 2015 07:15:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2502E260438; Sat, 18 Jul 2015 09:15:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 04B6E260412; Sat, 18 Jul 2015 09:15:39 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 092F926172C; Fri, 17 Jul 2015 20:53:10 +0200 (CEST) Received: from smtp.smtpout.orange.fr (smtp08.smtpout.orange.fr [80.12.242.130]) by alsa0.perex.cz (Postfix) with ESMTP id DF66A26147A for ; Fri, 17 Jul 2015 20:53:02 +0200 (CEST) Received: from localhost.localdomain ([92.140.160.103]) by mwinf5d16 with ME id tWt01q00D2E8xV003Wt0Ad; Fri, 17 Jul 2015 20:53:02 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 17 Jul 2015 20:53:02 +0200 X-ME-IP: 92.140.160.103 From: Christophe JAILLET To: perex@perex.cz, tiwai@suse.com Date: Fri, 17 Jul 2015 20:33:21 +0200 Message-Id: <1437158001-29890-1-git-send-email-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.1.4 X-Antivirus: avast! (VPS 150717-0, 17/07/2015), Outbound message X-Antivirus-Status: Clean X-Mailman-Approved-At: Sat, 18 Jul 2015 09:15:37 +0200 Cc: Christophe JAILLET , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ALSA: sparc: Add missing kfree in error path X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP If 'of_ioremap' fails, then 'amd' should be freed, otherwise, there is a memory leak. Signed-off-by: Christophe JAILLET --- sound/sparc/amd7930.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c index 1b1a89e..784ceb8 100644 --- a/sound/sparc/amd7930.c +++ b/sound/sparc/amd7930.c @@ -956,6 +956,7 @@ static int snd_amd7930_create(struct snd_card *card, if (!amd->regs) { snd_printk(KERN_ERR "amd7930-%d: Unable to map chip registers.\n", dev); + kfree(amd); return -EIO; }