Commit a6923156 authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Greg Kroah-Hartman

ALSA: usb-audio: fix rate_list memory leak

commit 5cd5d7c4 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: default avatar"Alexander E. Patrakov" <patrakov@gmail.com>
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 08bbb19d
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment