Skip to contentSkip to conversation

ALSA: usb-audio: Fix memory leak in FTU quirk

PATCH Superseded Takashi Iwai 1 participant 2 messages Nov 11, 2014 Sound

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: usb-audio: Fix memory leak in FTU quirk

M-audio FastTrack Ultra quirk doesn't release the kzalloc'ed memory. This patch adds the private_free callback to release it properly.

---
 sound/usb/mixer_quirks.c | 1 +
 1 file changed, 1 insertion(+)
sound/usb/mixer_quirks.c +1 -0
index 45203168ac6d..f6f8acf0446b 100644
@@ -1021,6 +1021,7 @@ static int snd_ftu_create_effect_switch(struct usb_mixer_interface *mixer,
 		return -ENOMEM;
 	}
 
+	kctl->private_free = usb_mixer_elem_free;
 	err = snd_ctl_add(mixer->chip->card, kctl);
 	if (err < 0)
 		return err;
Signature · 1 line
2.1.3
#1 lore raw

At Tue, 11 Nov 2014 17:59:41 +0100,

Quoted 6 lines · Takashi Iwai

M-audio FastTrack Ultra quirk doesn't release the kzalloc'ed memory. This patch adds the private_free callback to release it properly.

Scratch this, the quirk takes private_value, not private_data. Will resubmit the correct patch.

Takashi

Quoted 19 lines
---
 sound/usb/mixer_quirks.c | 1 +
 1 file changed, 1 insertion(+)
sound/usb/mixer_quirks.c +1 -0
index 45203168ac6d..f6f8acf0446b 100644
@@ -1021,6 +1021,7 @@ static int snd_ftu_create_effect_switch(struct usb_mixer_interface *mixer,
 		return -ENOMEM;
 	}
 
+	kctl->private_free = usb_mixer_elem_free;
 	err = snd_ctl_add(mixer->chip->card, kctl);
 	if (err < 0)
 		return err;
Signature · 1 line
2.1.3