ASoC: wm8940: fix a memory leak if wm8940_register return error
authorAxel Lin <axel.lin@gmail.com>
Fri, 23 Jul 2010 05:53:49 +0000 (05:53 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 3 Aug 2010 06:45:20 +0000 (07:45 +0100)
commitdb1e18de98c8bdf8a2bfc07623ff67621aa4a332
tree3681c2d5823befcc606d95bd06f5c4ca310986ae
parent62f5ad6733b872e14d671b615850eb5bd1cd7e30
ASoC: wm8940: fix a memory leak if wm8940_register return error

This patch adds checking for wm8940_register return value,
and does kfree(wm8940) if wm8940_register() fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm8940.c