From: Jean Delvare Date: Tue, 30 Sep 2008 09:40:37 +0000 (+0200) Subject: ALSA: ASoC: Fix cs4270 error path X-Git-Tag: v2.6.27-rc9~52^2~1 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=e3145dfb7b4262fa55907006b75da799de8c1be3;hp=e3145dfb7b4262fa55907006b75da799de8c1be3 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 Acked-by: Timur Tabi Signed-off-by: Takashi Iwai ---