]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: ASoC: Fix cs4270 error path
authorJean Delvare <khali@linux-fr.org>
Tue, 30 Sep 2008 09:40:37 +0000 (11:40 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 30 Sep 2008 10:47:12 +0000 (12:47 +0200)
commit5a643b32ba2f7ae07a39b943b75ed86d44b050a8
tree5260088839385b751953cb0ad47cef9633f9ad23
parent15f85e24e10a3ef27e932c01a7d0805d4da397e2
ALSA: ASoC: Fix cs4270 error path

The error path in cs4270_probe/cs4270_remove is pretty broken:
* If cs4270_probe fails, codec is leaked.
* If snd_soc_register_card fails, cs4270_i2c_driver stays registered.
* If I2C support is enabled but no I2C device is found, i2c_del_driver
  is never called (neither in cs4270_probe nor in cs4270_remove.

Fix all 3 problems by implementing a clean error path in cs4270_probe
and jumping to its labels as needed.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/soc/codecs/cs4270.c