• Wenwen Wang's avatar
    ALSA: usb-audio: fix a memory leak bug · a6706020
    Wenwen Wang authored
    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: 7edf3b5e ("ALSA: usb-audio: AudioStreaming Power Domain parsing")
    Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    a6706020
stream.c 31.2 KB