Re: [PATCH] ALSA: usb-audio: fix a memory leak bug

From: Takashi Iwai
Date: Tue Aug 06 2019 - 06:47:24 EST


On Tue, 06 Aug 2019 09:00:27 +0200,
Wenwen Wang wrote:
>
> 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.
>
> Signed-off-by: Wenwen Wang <wenwen@xxxxxxxxxx>

Applied, thanks.


Takashi