diff options
Diffstat (limited to 'drivers/hwmon/hwmon.c')
-rw-r--r-- | drivers/hwmon/hwmon.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 975c95169884..84f61cec6319 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c | |||
@@ -649,8 +649,10 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, | |||
649 | if (info[i]->config[j] & HWMON_T_INPUT) { | 649 | if (info[i]->config[j] & HWMON_T_INPUT) { |
650 | err = hwmon_thermal_add_sensor(dev, | 650 | err = hwmon_thermal_add_sensor(dev, |
651 | hwdev, j); | 651 | hwdev, j); |
652 | if (err) | 652 | if (err) { |
653 | goto free_device; | 653 | device_unregister(hdev); |
654 | goto ida_remove; | ||
655 | } | ||
654 | } | 656 | } |
655 | } | 657 | } |
656 | } | 658 | } |
@@ -658,8 +660,6 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, | |||
658 | 660 | ||
659 | return hdev; | 661 | return hdev; |
660 | 662 | ||
661 | free_device: | ||
662 | device_unregister(hdev); | ||
663 | free_hwmon: | 663 | free_hwmon: |
664 | kfree(hwdev); | 664 | kfree(hwdev); |
665 | ida_remove: | 665 | ida_remove: |