mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 10:46:33 +00:00
ALSA: control - double free in snd_ctl_led_init()
"group - 1" was intended here instead of "group". The current error handling will double free the first item in the array and leak the last item. Fixes: cb17fe0045aa ("ALSA: control - add sysfs support to the LED trigger module") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/YHBJ4frGxErWB182@mwanda Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
64f40f9be1
commit
57b138dde3
@ -734,7 +734,7 @@ static int __init snd_ctl_led_init(void)
|
||||
if (device_add(&led->dev)) {
|
||||
put_device(&led->dev);
|
||||
for (; group > 0; group--) {
|
||||
led = &snd_ctl_leds[group];
|
||||
led = &snd_ctl_leds[group - 1];
|
||||
device_del(&led->dev);
|
||||
}
|
||||
device_del(&snd_ctl_led_dev);
|
||||
|
Loading…
x
Reference in New Issue
Block a user