• Wenwen Wang's avatar
    ALSA: hda - Fix a memory leak bug · cfef67f0
    Wenwen Wang authored
    In snd_hda_parse_generic_codec(), 'spec' is allocated through kzalloc().
    Then, the pin widgets in 'codec' are parsed. However, if the parsing
    process fails, 'spec' is not deallocated, leading to a memory leak.
    
    To fix the above issue, free 'spec' before returning the error.
    
    Fixes: 352f7f91 ("ALSA: hda - Merge Realtek parser code to generic parser")
    Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    cfef67f0
hda_generic.c 164 KB