diff mbox

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

Message ID 1415725181-7079-1-git-send-email-tiwai@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Iwai Nov. 11, 2014, 4:59 p.m. UTC
M-audio FastTrack Ultra quirk doesn't release the kzalloc'ed memory.
This patch adds the private_free callback to release it properly.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/usb/mixer_quirks.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Takashi Iwai Nov. 11, 2014, 5:06 p.m. UTC | #1
At Tue, 11 Nov 2014 17:59:41 +0100,
Takashi Iwai wrote:
> 
> M-audio FastTrack Ultra quirk doesn't release the kzalloc'ed memory.
> This patch adds the private_free callback to release it properly.
> 
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

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


Takashi

> ---
>  sound/usb/mixer_quirks.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
> index 45203168ac6d..f6f8acf0446b 100644
> --- a/sound/usb/mixer_quirks.c
> +++ b/sound/usb/mixer_quirks.c
> @@ -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;
> -- 
> 2.1.3
>
diff mbox

Patch

diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 45203168ac6d..f6f8acf0446b 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -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;