All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] hwmon: (ads7871) Fix ads7871_probe error path
@ 2010-08-16  1:31 ` Axel Lin
  0 siblings, 0 replies; 12+ messages in thread
From: Axel Lin @ 2010-08-16  1:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Thomas, Jean Delvare, lm-sensors

We need to call hwmon_device_unregister() if an error is detected after
sucessfully register hwmon device.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/hwmon/ads7871.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/hwmon/ads7871.c b/drivers/hwmon/ads7871.c
index b300a20..303db92 100644
--- a/drivers/hwmon/ads7871.c
+++ b/drivers/hwmon/ads7871.c
@@ -201,11 +201,13 @@ static int __devinit ads7871_probe(struct spi_device *spi)
 	we need to make sure we really have a chip*/
 	if (val != ret) {
 		err = -ENODEV;
-		goto error_remove;
+		goto error_unregister;
 	}
 
 	return 0;
 
+error_unregister:
+	hwmon_device_unregister(pdata->hwmon_dev);
 error_remove:
 	sysfs_remove_group(&spi->dev.kobj, &ads7871_group);
 error_free:
-- 
1.7.2




_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-08-22 20:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-16  1:31 [lm-sensors] [PATCH] hwmon: (ads7871) Fix ads7871_probe error path Axel Lin
2010-08-16  1:31 ` Axel Lin
2010-08-17 11:07 ` [lm-sensors] [PATCH] hwmon: (ads7871) Fix ads7871_probe error Jean Delvare
2010-08-17 11:07   ` [PATCH] hwmon: (ads7871) Fix ads7871_probe error path Jean Delvare
2010-08-17 15:15   ` [lm-sensors] [PATCH] hwmon: (ads7871) Fix ads7871_probe error Paul Thomas
2010-08-17 15:15     ` [PATCH] hwmon: (ads7871) Fix ads7871_probe error path Paul Thomas
2010-08-17 18:42     ` [lm-sensors] [PATCH] hwmon: (ads7871) Fix ads7871_probe error Jean Delvare
2010-08-17 18:42       ` [PATCH] hwmon: (ads7871) Fix ads7871_probe error path Jean Delvare
2010-08-22 14:25 ` [lm-sensors] [PATCH] hwmon: (ads7871) Fix ads7871_probe init path Axel Lin
2010-08-22 14:25   ` Axel Lin
2010-08-22 20:48   ` [lm-sensors] [PATCH] hwmon: (ads7871) Fix ads7871_probe init Jean Delvare
2010-08-22 20:48     ` [PATCH] hwmon: (ads7871) Fix ads7871_probe init path Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.