diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2012-05-18 12:00:43 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-05-31 04:25:44 -0400 |
commit | 5cd5d7c44990658df6ab49f6253c39617c53b03d (patch) | |
tree | 88c36facfd9b20e8afbbe087abea5bde2e65e61e /sound | |
parent | adcc70b249ca77c1197eb62b1645146721ba6e5b (diff) |
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>
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 24839d932648..cdf8b7601973 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
@@ -788,6 +788,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime, | |||
788 | int count = 0, needs_knot = 0; | 788 | int count = 0, needs_knot = 0; |
789 | int err; | 789 | int err; |
790 | 790 | ||
791 | kfree(subs->rate_list.list); | ||
792 | subs->rate_list.list = NULL; | ||
793 | |||
791 | list_for_each_entry(fp, &subs->fmt_list, list) { | 794 | list_for_each_entry(fp, &subs->fmt_list, list) { |
792 | if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS) | 795 | if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS) |
793 | return 0; | 796 | return 0; |