ALSA: usb-audio: fix rate_list memory leak
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> Cc: <stable@vger.kernel.org> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
adcc70b249
commit
5cd5d7c449
|
@ -788,6 +788,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime,
|
||||||
int count = 0, needs_knot = 0;
|
int count = 0, needs_knot = 0;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
kfree(subs->rate_list.list);
|
||||||
|
subs->rate_list.list = NULL;
|
||||||
|
|
||||||
list_for_each_entry(fp, &subs->fmt_list, list) {
|
list_for_each_entry(fp, &subs->fmt_list, list) {
|
||||||
if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS)
|
if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue