]> Git Repo - linux.git/commitdiff
ALSA: usb-audio: fix rate_list memory leak
authorClemens Ladisch <[email protected]>
Fri, 18 May 2012 16:00:43 +0000 (18:00 +0200)
committerTakashi Iwai <[email protected]>
Thu, 31 May 2012 08:25:44 +0000 (10:25 +0200)
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" <[email protected]>
Cc: <[email protected]>
Signed-off-by: Clemens Ladisch <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
sound/usb/pcm.c

index 24839d932648c81849ecfe63214a8124d914dd0e..cdf8b7601973406c445c69c6e5cd4afbdbbdf23b 100644 (file)
@@ -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;
This page took 0.055661 seconds and 4 git commands to generate.