https://github.com/torvalds/linux
Revision 7d7eb9ea314e992413620610b4d09c9cd5fa8959 authored by Jesper Juhl on 12 April 2012, 20:11:25 UTC, committed by Takashi Iwai on 13 April 2012, 05:35:57 UTC
In sound/pci/hda/patch_realtek.c::alc_auto_fill_dac_nids(), in the
'for (;;)' loop, if the 'badness' value returned from
fill_and_eval_dacs() is negative, then we'll return from the function
without freeing the memory we allocated for 'best_cfg', thus leaking.
Fix the leak by kfree()'ing the memory when badness is negative.

While I was there I also noticed some trailing whitespace in the
function that I removed (along with all other trailing whitespace in
the file) - it didn't seem worth-while to do that as two patches, so I
hope it's OK that I just did it all as one patch.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 29ebe40
History
Tip revision: 7d7eb9ea314e992413620610b4d09c9cd5fa8959 authored by Jesper Juhl on 12 April 2012, 20:11:25 UTC
ALSA: hda/realtek - Fix mem leak (and rid us of trailing whitespace).
Tip revision: 7d7eb9e

README.AddingFirmware

back to top