All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Wenwen Wang" <wang6495@umn.edu>
Cc: "moderated list:SOUND" <alsa-devel@alsa-project.org>,
	"Jorge Sanjuan" <jorge.sanjuan@codethink.co.uk>,
	"Ruslan Bilovol" <ruslan.bilovol@gmail.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ALSA: usb-audio: Fix a memory leak bug
Date: Sun, 28 Apr 2019 09:12:15 +0200	[thread overview]
Message-ID: <s5hef5mmwmo.wl-tiwai@suse.de> (raw)
In-Reply-To: <1556345208-1210-1-git-send-email-wang6495@umn.edu>

On Sat, 27 Apr 2019 08:06:46 +0200,
Wenwen Wang wrote:
> 
> In parse_audio_selector_unit(), the string array 'namelist' is allocated
> through kmalloc_array(), and each string pointer in this array, i.e.,
> 'namelist[]', is allocated through kmalloc() in the following for loop.
> Then, a control instance 'kctl' is created by invoking snd_ctl_new1(). If
> an error occurs during the creation process, the string array 'namelist',
> including all string pointers in the array 'namelist[]', should be freed,
> before the error code ENOMEM is returned. However, the current code does
> not free 'namelist[]', resulting in memory leaks.
> 
> To fix the above issue, free all string pointers 'namelist[]' in a loop.
> 
> Signed-off-by: Wenwen Wang <wang6495@umn.edu>

Applied now, thanks.


Takashi

  reply	other threads:[~2019-04-28  7:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-27  6:06 [PATCH] ALSA: usb-audio: Fix a memory leak bug Wenwen Wang
2019-04-27  6:06 ` Wenwen Wang
2019-04-28  7:12 ` Takashi Iwai [this message]
2019-08-06  6:13 [PATCH] ALSA: usb-audio: fix " Wenwen Wang
2019-08-06  6:40 ` Takashi Iwai
2019-08-06  7:00 Wenwen Wang
2019-08-06 10:47 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hef5mmwmo.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=jorge.sanjuan@codethink.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=ruslan.bilovol@gmail.com \
    --cc=wang6495@umn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.