From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753569AbbGQUac (ORCPT ); Fri, 17 Jul 2015 16:30:32 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52309 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752073AbbGQUab (ORCPT ); Fri, 17 Jul 2015 16:30:31 -0400 Date: Fri, 17 Jul 2015 22:30:29 +0200 Message-ID: From: Takashi Iwai To: "Christophe JAILLET" Cc: , , , Subject: Re: [PATCH] ALSA: sparc: Add missing kfree in error path In-Reply-To: <1437158001-29890-1-git-send-email-christophe.jaillet@wanadoo.fr> References: <1437158001-29890-1-git-send-email-christophe.jaillet@wanadoo.fr> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.5 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 17 Jul 2015 20:33:21 +0200, Christophe JAILLET wrote: > > If 'of_ioremap' fails, then 'amd' should be freed, otherwise, there is a > memory leak. > > Signed-off-by: Christophe JAILLET Applied, thanks. Takashi > --- > 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; > } > > -- > 2.1.4 > >