]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: wm8523: fix resource reclaim in wm8523_register error path
authorAxel Lin <axel.lin@gmail.com>
Fri, 23 Jul 2010 05:53:46 +0000 (05:53 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 3 Aug 2010 06:44:10 +0000 (07:44 +0100)
commit890b85b787efb0f4e83d1385692d1314087e1294
tree1c32888426a73c44d284c8157470af5c1d6de7ae
parenta61aac9439fef9d6ff245d8be5f2bff3a60118f1
ASoC: wm8523: fix resource reclaim in wm8523_register error path

This patch includes below fixes:
1. If another WM8523 is registered, need to kfree wm8523 before return -EINVAL.
2. If snd_soc_register_codec failed, goto error path to properly free resources.
3. Instead of using mixed in-line and goto style cleanup, use goto style error
   handling if snd_soc_register_dai failed.

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/wm8523.c