From: Takashi Iwai <tiwai@suse.de>
To: Wenwen Wang <wenwen@cs.uga.edu>
Cc: "moderated list:SOUND" <alsa-devel@alsa-project.org>,
Jaroslav Kysela <perex@perex.cz>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sound: fix a memory leak bug
Date: Thu, 08 Aug 2019 08:20:28 +0200 [thread overview]
Message-ID: <s5hwofokwk3.wl-tiwai@suse.de> (raw)
In-Reply-To: <1565241321-2418-1-git-send-email-wenwen@cs.uga.edu>
On Thu, 08 Aug 2019 07:15:21 +0200,
Wenwen Wang wrote:
>
> In sound_insert_unit(), the controlling structure 's' is allocated through
> kmalloc(). Then it is added to the sound driver list by invoking
> __sound_insert_unit(). Later on, if __register_chrdev() fails, 's' is
> removed from the list through __sound_remove_unit(). If 'index' is not less
> than 0, -EBUSY is returned to indicate the error. However, 's' is not
> deallocated on this execution path, leading to a memory leak bug.
>
> To fix the above issue, free 's' before -EBUSY is returned.
>
> Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Oh, it's a really old bug. Applied now.
Thanks!
Takashi
prev parent reply other threads:[~2019-08-08 6:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 5:15 [PATCH] sound: fix a memory leak bug Wenwen Wang
2019-08-08 6:20 ` Takashi Iwai [this message]
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=s5hwofokwk3.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=wenwen@cs.uga.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox