Axel Lin 4f5b7994f0 hwmon: (gpio-fan) Fix fan_ctrl_init error path
In current implementation, the sysfs entries is not removed before return -ENODEV.

Creating the sysfs attribute should be the last thing done by the function,
after all the rest has been successful.
Otherwise there is a small window during which user-space can access the attribute
but the driver isn't ready to deal with the requests.

Fix it by moving sysfs_create_group to be the last thing done by the function.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Simon Guinot <sguinot@lacie.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-11-11 09:43:51 -08:00
..
2009-12-14 21:17:27 +01:00
2009-12-14 21:17:26 +01:00
2009-12-14 21:17:27 +01:00
2009-12-14 21:17:26 +01:00
2010-10-28 20:31:50 +02:00
2010-01-25 15:00:49 +01:00
2009-12-14 21:17:26 +01:00
2010-10-28 20:31:50 +02:00
2010-05-27 19:59:01 +02:00
2009-12-14 21:17:26 +01:00
2009-12-14 21:17:27 +01:00
2009-12-14 21:17:26 +01:00
2010-08-05 13:26:19 +01:00
2009-12-14 21:17:26 +01:00
2009-12-14 21:17:26 +01:00
2009-12-14 21:17:27 +01:00
2009-12-14 21:17:27 +01:00
2009-12-14 21:17:26 +01:00
2009-12-14 21:17:26 +01:00
2010-10-28 20:31:50 +02:00
2009-12-14 21:17:26 +01:00
2009-12-14 21:17:26 +01:00
2010-01-10 20:52:35 +01:00
2009-12-14 21:17:26 +01:00
2009-12-14 21:17:27 +01:00
2010-10-28 20:31:50 +02:00
2010-01-10 20:52:35 +01:00
2009-09-15 17:18:13 +02:00
2009-12-14 21:17:26 +01:00
2009-12-14 21:17:26 +01:00
2009-12-14 21:17:26 +01:00
2009-12-14 21:17:26 +01:00