]> git.baikalelectronics.ru Git - kernel.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)
committerTakashi Iwai <tiwai@suse.de>
Tue, 6 Aug 2019 10:44:44 +0000 (12:44 +0200)
commit74d7afa679401b6aa0b05bacf6bab02f9f149d7e
treed87075ec063df5a0a5fd98c92a708bbfa7cb2b36
parent5d7f234efae3ab0049f05e252e3dd701b2b337ed
ALSA: usb-audio: fix a memory leak bug

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: 9a8eb0804727 ("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>
sound/usb/stream.c