From: Dan Carpenter <dan.carpenter@oracle.com>
To: 慕冬亮 <mudongliangabcd@gmail.com>
Cc: perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org,
linux-kernel <linux-kernel@vger.kernel.org>,
syzbot+08a7d8b51ea048a74ffb@syzkaller.appspotmail.com
Subject: Re: [PATCH] ALSA: control led: fix memory leak in snd_ctl_led_register
Date: Mon, 31 May 2021 07:36:19 +0300 [thread overview]
Message-ID: <20210531043619.GT24442@kadam> (raw)
In-Reply-To: <A622EB84-DC4A-47A4-A828-CE6D25DC92EB@gmail.com>
On Sat, May 29, 2021 at 05:35:22AM +0800, 慕冬亮 wrote:
> > diff --git a/sound/core/control_led.c b/sound/core/control_led.c
> > index 25f57c14f294..dd357abc1b58 100644
> > --- a/sound/core/control_led.c
> > +++ b/sound/core/control_led.c
> > @@ -740,6 +740,7 @@ static int __init snd_ctl_led_init(void)
> > for (; group > 0; group--) {
> > led = &snd_ctl_leds[group - 1];
> > device_del(&led->dev);
> > + device_put(&led->dev);
> > }
> > device_del(&snd_ctl_led_dev);
> > return -ENOMEM;
> > @@ -768,6 +769,7 @@ static void __exit snd_ctl_led_exit(void)
> > for (group = 0; group < MAX_LED; group++) {
> > led = &snd_ctl_leds[group];
> > device_del(&led->dev);
> > + device_put(&led->dev);
> > }
> > device_del(&snd_ctl_led_dev);
> > snd_ctl_led_clean(NULL);
>
> Does this patch mean I should add device_put in the init and exit
> function other than snd_ctl_led_sysfs_remove? This will cause
> device_release bypass the release method checking?
Please fix your email client to line wrap your emails.
I'm not sure what release method checking you're refering to.
regards,
dan carpenter
next prev parent reply other threads:[~2021-05-31 4:37 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-28 13:17 [PATCH] ALSA: control led: fix memory leak in snd_ctl_led_register Dongliang Mu
2021-05-28 13:33 ` Dan Carpenter
2021-05-28 13:50 ` Dongliang Mu
2021-05-28 14:05 ` Dan Carpenter
2021-05-28 21:35 ` 慕冬亮
2021-05-31 3:03 ` Dongliang Mu
2021-05-31 4:40 ` Dan Carpenter
2021-05-31 6:20 ` Dongliang Mu
2021-05-31 7:03 ` Dan Carpenter
2021-05-31 7:34 ` Dongliang Mu
2021-05-31 8:08 ` Dongliang Mu
2021-05-31 8:46 ` Dan Carpenter
2021-05-31 9:10 ` Dongliang Mu
2021-05-31 9:38 ` Dan Carpenter
2021-05-31 10:35 ` Dongliang Mu
2021-05-31 10:43 ` Dan Carpenter
2021-05-31 10:59 ` Dongliang Mu
2021-05-31 8:12 ` Dan Carpenter
2021-05-31 4:36 ` Dan Carpenter [this message]
2021-05-31 11:01 ` Dan Carpenter
2021-05-31 11:07 ` Dan Carpenter
2021-05-31 11:11 ` Dongliang Mu
2021-06-01 13:17 ` Dongliang Mu
2021-06-01 13:46 ` Dan Carpenter
2021-06-01 14:19 ` Dongliang Mu
2021-06-01 14:43 ` Dan Carpenter
2021-06-01 15:52 ` Dongliang Mu
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=20210531043619.GT24442@kadam \
--to=dan.carpenter@oracle.com \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mudongliangabcd@gmail.com \
--cc=perex@perex.cz \
--cc=syzbot+08a7d8b51ea048a74ffb@syzkaller.appspotmail.com \
--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