From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Jaroslav Kysela <perex@perex.cz>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org
Subject: Re: [PATCH] ALSA: core: control_led: fix memory leak in snd_ctl_led_set_state()
Date: Tue, 6 Apr 2021 10:16:34 +0900 [thread overview]
Message-ID: <20210406011634.GA53518@workstation> (raw)
In-Reply-To: <f0490845-a455-ceb7-3dae-6dda23cef070@perex.cz>
On Sun, Apr 04, 2021 at 10:16:03AM +0200, Jaroslav Kysela wrote:
> Dne 04. 04. 21 v 8:40 Takashi Sakamoto napsal(a):
> > When inquired control element is not in led group, snd_ctl_led_set_state()
> > attempts to add the element into the group, according to function
> > arguments. Although an memory object is allocated for led instance, it's
> > left as is without being released.
> >
> > This commit fixes the memory leak.
> >
> > Fixes: 22d8de62f11b ("ALSA: control - add generic LED trigger module as the new control layer")
> > Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> > ---
> > sound/core/control_led.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/sound/core/control_led.c b/sound/core/control_led.c
> > index 788fd9e275e0..b97f118cd54e 100644
> > --- a/sound/core/control_led.c
> > +++ b/sound/core/control_led.c
> > @@ -161,6 +161,7 @@ static void snd_ctl_led_set_state(struct snd_card *card, unsigned int access,
> > list_add(&lctl->list, &led->controls);
> > UPDATE_ROUTE(route, snd_ctl_led_get(lctl));
> > }
> > + kfree(lctl);
>
> NAK: The lctl pointer is added to led->controls list to track the related
> kctl. The kfree is called from snd_ctl_led_clean().
Ah. I overlooked it. Please abandon the patch.
Regards
Takashi Sakamoto
prev parent reply other threads:[~2021-04-06 1:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-04 6:40 [PATCH] ALSA: core: control_led: fix memory leak in snd_ctl_led_set_state() Takashi Sakamoto
2021-04-04 8:16 ` Jaroslav Kysela
2021-04-06 1:16 ` Takashi Sakamoto [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=20210406011634.GA53518@workstation \
--to=o-takashi@sakamocchi.jp \
--cc=alsa-devel@alsa-project.org \
--cc=perex@perex.cz \
--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 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.