mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 13:44:15 +08:00
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 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;
|
||||
|
Loading…
Reference in New Issue
Block a user