]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda/realtek - Fix mem leak (and rid us of trailing whitespace).
authorJesper Juhl <jj@chaosbits.net>
Thu, 12 Apr 2012 20:11:25 +0000 (22:11 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 13 Apr 2012 05:35:57 +0000 (07:35 +0200)
commitb1a9a86271dbafda481f5824dde259003f6478bc
tree159a2cc18ad80868af18d7a0675a940c457e1536
parentd9cef6b59241a84d1adee8cc660cdf2f78455c9b
ALSA: hda/realtek - Fix mem leak (and rid us of trailing whitespace).

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>
sound/pci/hda/patch_realtek.c