]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: wm8978: fix a memory leak if a wm8978_register fail
authorAxel Lin <axel.lin@gmail.com>
Fri, 23 Jul 2010 05:53:53 +0000 (05:53 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 3 Aug 2010 06:46:27 +0000 (07:46 +0100)
commit83f1e379c3f1f9d801ef7960095d3c2259459071
treea560757325c9c842e12c4f87b25e759b1997a341
parentc9db0c191bad89cfd6dd3c81beb9c05992905690
ASoC: wm8978: fix a memory leak if a wm8978_register fail

There is a memory leak found if wm8978_register() fail.
This patch moves the buffer allocate and release
at the same level to prevent the memory leak.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm8978.c