diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2012-05-18 18:00:43 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-10 00:33:01 +0900 |
commit | a6923156ec0556f79a8ec5deb40d1aa929184b21 (patch) | |
tree | bbcc7aea67a910160b3e6828824a1cd3b7352c95 /sound | |
parent | 08bbb19de6601c4205419ad3c30b730693919b07 (diff) |
ALSA: usb-audio: fix rate_list memory leak
commit 5cd5d7c44990658df6ab49f6253c39617c53b03d upstream.
The array of sample rates is reallocated every time when opening
the PCM device, but was freed only once when unplugging the device.
Reported-by: "Alexander E. Patrakov" <patrakov@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
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/pcm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index b8dcbf407bbb..506c0fa679f6 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -670,6 +670,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime, int count = 0, needs_knot = 0; int err; + kfree(subs->rate_list.list); + subs->rate_list.list = NULL; + list_for_each_entry(fp, &subs->fmt_list, list) { if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS) return 0; |