From: dinghao.liu@zju.edu.cn
To: "Takashi Iwai" <tiwai@suse.de>
Cc: kjlu@umn.edu, "Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>, "Geoffrey D. Bennett" <g@b4.vu>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH] ALSA: usb-audio: Fix memleak in scarlett2_add_new_ctl
Date: Fri, 7 Aug 2020 17:50:13 +0800 (GMT+08:00) [thread overview]
Message-ID: <2632689f.4acd5.173c853f824.Coremail.dinghao.liu@zju.edu.cn> (raw)
In-Reply-To: <s5htuxeanl2.wl-tiwai@suse.de>
"Takashi Iwai" <tiwai@suse.de>写道:
> On Fri, 07 Aug 2020 09:12:27 +0200,
> Dinghao Liu wrote:
> >
> > When snd_usb_mixer_add_control() fails, elem needs to be
> > freed just like when snd_ctl_new1() fails. However, current
> > code is returning directly and ends up leaking memory.
>
> No, this would lead to double-free. snd_ctl_add() shows a kind of
> special behavior, it already releases the object at its error path.
>
It's clear to me, thanks!
Regards,
Dinghao
prev parent reply other threads:[~2020-08-07 9:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-07 7:12 Dinghao Liu
2020-08-07 8:04 ` Takashi Iwai
2020-08-07 9:50 ` dinghao.liu [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=2632689f.4acd5.173c853f824.Coremail.dinghao.liu@zju.edu.cn \
--to=dinghao.liu@zju.edu.cn \
--cc=alsa-devel@alsa-project.org \
--cc=g@b4.vu \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=tiwai@suse.de \
/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
all inboxes | Powered by JetHome®