diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-11-11 15:45:57 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-21 09:22:52 -0800 |
commit | 9a262b4b21aaebe6323b2b8362465ca796f12768 (patch) | |
tree | 8fe3609766ca055f70ff0c79759aabce31cec7e9 /sound | |
parent | 9921a2d59ae1ad736ef4e6abf2a67d961e74a95c (diff) | |
download | lwn-9a262b4b21aaebe6323b2b8362465ca796f12768.tar.gz lwn-9a262b4b21aaebe6323b2b8362465ca796f12768.zip |
ALSA: usb-audio: Fix memory leak in FTU quirk
commit 1a290581ded60e87276741f8ca97b161d2b226fc upstream.
M-audio FastTrack Ultra quirk doesn't release the kzalloc'ed memory.
This patch adds the private_free callback to release it properly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/mixer_quirks.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index ebe91440a068..c89a5bf5c00e 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -799,6 +799,11 @@ static int snd_ftu_eff_switch_put(struct snd_kcontrol *kctl, return changed; } +static void kctl_private_value_free(struct snd_kcontrol *kctl) +{ + kfree((void *)kctl->private_value); +} + static int snd_ftu_create_effect_switch(struct usb_mixer_interface *mixer, int validx, int bUnitID) { @@ -833,6 +838,7 @@ static int snd_ftu_create_effect_switch(struct usb_mixer_interface *mixer, return -ENOMEM; } + kctl->private_free = kctl_private_value_free; err = snd_ctl_add(mixer->chip->card, kctl); if (err < 0) return err; |