]> www.infradead.org Git - users/dwmw2/linux.git/commit
ALSA: usb-audio: fix a memory leak bug
authorWenwen Wang <wenwen@cs.uga.edu>
Tue, 6 Aug 2019 07:00:27 +0000 (03:00 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:11:08 +0000 (10:11 +0200)
commit99be0ce782720e4cd6139e8d1e1144f1d06aecfe
treebde3cfcfea00b12be628696c1adc10382d7cef36
parentbba097c444618e07aac4f1d1dee172284b1f5b5d
ALSA: usb-audio: fix a memory leak bug

commit a67060201b746a308b1674f66bf289c9faef6d09 upstream.

In snd_usb_get_audioformat_uac3(), a structure for channel maps 'chmap' is
allocated through kzalloc() before the execution goto 'found_clock'.
However, this structure is not deallocated if the memory allocation for
'pd' fails, leading to a memory leak bug.

To fix the above issue, free 'fp->chmap' before returning NULL.

Fixes: 7edf3b5e6a45 ("ALSA: usb-audio: AudioStreaming Power Domain parsing")
Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/stream.c