]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
sound: ASoC: Fix an error path in neo1973_wm8753
authorJean Delvare <khali@linux-fr.org>
Mon, 1 Sep 2008 15:44:05 +0000 (17:44 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 9 Sep 2008 07:11:07 +0000 (09:11 +0200)
commitd280289e799dcdf5913e8935bffe136d7594e26d
treee9fd22eb177d971895093583a70ef6e54db1f899
parentdfdf34bbcbb2687d3a5fa723279124df9e309195
sound: ASoC: Fix an error path in neo1973_wm8753

The error handling in neo1973_init is incorrect:

* If platform_device_add fails, we go on with the rest of the
  initialization instead of bailing out. Things will break when the
  module is removed (platform_device_unregister called on a device
  that wasn't registered.)

* If i2c_add_driver fails, we return an error so the module will not
  load, but we don't unregister neo1973_snd_device, so we are leaking
  resources.

Add the missing error handling.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Tim Niemeyer <reddog@mastersword.de>
Cc: Graeme Gregory <graeme@openmoko.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/soc/s3c24xx/neo1973_wm8753.c