From: Takashi Iwai <tiwai@suse.de>
To: Navid Emamdoost <navid.emamdoost@gmail.com>
Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Thomas Gleixner <tglx@linutronix.de>,
Richard Fontana <rfontana@redhat.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: pci: Fix memory leak in snd_ali_create
Date: Mon, 28 Oct 2019 07:32:54 +0100 [thread overview]
Message-ID: <s5hlft5mlbd.wl-tiwai@suse.de> (raw)
In-Reply-To: <20191027183030.12677-1-navid.emamdoost@gmail.com>
On Sun, 27 Oct 2019 19:30:27 +0100,
Navid Emamdoost wrote:
>
> In the implementation of snd_ali_create() the memory allocated for codec
> is leaked in case of an error. Release codec if snd_ali_chip_init()
> fails.
Once again, this is a wrong fix. The code path is after
snd_device_new() with the free op, so the object gets already released
there.
thanks,
Takashi
>
> Fixes: f9ab2b1c3ab5 ("[ALSA] ali5451 - Code clean up, irq handler fix")
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---
> sound/pci/ali5451/ali5451.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
> index 6e28e381c21a..3ed07a18be4d 100644
> --- a/sound/pci/ali5451/ali5451.c
> +++ b/sound/pci/ali5451/ali5451.c
> @@ -2179,6 +2179,7 @@ static int snd_ali_create(struct snd_card *card,
> err = snd_ali_chip_init(codec);
> if (err < 0) {
> dev_err(card->dev, "ali create: chip init error.\n");
> + snd_ali_free(codec);
> return err;
> }
>
> --
> 2.17.1
>
prev parent reply other threads:[~2019-10-28 6:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-27 18:30 [PATCH] ALSA: pci: Fix memory leak in snd_ali_create Navid Emamdoost
2019-10-28 6:32 ` 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=s5hlft5mlbd.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=emamd001@umn.edu \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=navid.emamdoost@gmail.com \
--cc=perex@perex.cz \
--cc=rfontana@redhat.com \
--cc=smccaman@umn.edu \
--cc=tglx@linutronix.de \
--cc=tiwai@suse.com \
/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