aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/hwmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/hwmon.c')
-rw-r--r--drivers/hwmon/hwmon.c8
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
661free_device:
662 device_unregister(hdev);
663free_hwmon: 663free_hwmon:
664 kfree(hwdev); 664 kfree(hwdev);
665ida_remove: 665ida_remove: