From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757199AbaFAMfU (ORCPT ); Sun, 1 Jun 2014 08:35:20 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56703 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756907AbaFAMfT (ORCPT ); Sun, 1 Jun 2014 08:35:19 -0400 Date: Sun, 01 Jun 2014 14:35:15 +0200 Message-ID: From: Takashi Iwai To: Rickard Strandqvist Cc: Jaroslav Kysela , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sound: synth: emux: soundfont.c: Cleaning up memory leak In-Reply-To: <1401622524-13636-1-git-send-email-rickard_strandqvist@spectrumdigital.se> References: <1401622524-13636-1-git-send-email-rickard_strandqvist@spectrumdigital.se> 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.3 (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 At Sun, 1 Jun 2014 13:35:24 +0200, Rickard Strandqvist wrote: > > There is a risk for memory leak in when something unexpected happens > and the function returns. > > This was largely found by using a static code analysis program called cppcheck. > > Signed-off-by: Rickard Strandqvist > --- > sound/synth/emux/soundfont.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c > index 1137b85..09c5eeb 100644 > --- a/sound/synth/emux/soundfont.c > +++ b/sound/synth/emux/soundfont.c > @@ -1021,6 +1021,7 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data, > data, count); > if (rc < 0) { > sf_sample_delete(sflist, sf, smp); > + free(zone); I applied the patch with the correction of a typo (it must be kfree()). At the next time, please compile-test at least :) thanks, Takashi