Commit 85758777 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'hwmon-for-v4.20-rc2' of...

Merge tag 'hwmon-for-v4.20-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

 - Remove bogus __init annotations in ibmpowernv driver

 - Fix double-free in error handling of __hwmon_device_register()

* tag 'hwmon-for-v4.20-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (ibmpowernv) Remove bogus __init annotations
  hwmon: (core) Fix double-free in __hwmon_device_register()
parents e09d51ad e3e61f01
...@@ -649,8 +649,10 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, ...@@ -649,8 +649,10 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
if (info[i]->config[j] & HWMON_T_INPUT) { if (info[i]->config[j] & HWMON_T_INPUT) {
err = hwmon_thermal_add_sensor(dev, err = hwmon_thermal_add_sensor(dev,
hwdev, j); hwdev, j);
if (err) if (err) {
goto free_device; device_unregister(hdev);
goto ida_remove;
}
} }
} }
} }
...@@ -658,8 +660,6 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, ...@@ -658,8 +660,6 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
return hdev; return hdev;
free_device:
device_unregister(hdev);
free_hwmon: free_hwmon:
kfree(hwdev); kfree(hwdev);
ida_remove: ida_remove:
......
...@@ -181,7 +181,7 @@ static ssize_t show_label(struct device *dev, struct device_attribute *devattr, ...@@ -181,7 +181,7 @@ static ssize_t show_label(struct device *dev, struct device_attribute *devattr,
return sprintf(buf, "%s\n", sdata->label); return sprintf(buf, "%s\n", sdata->label);
} }
static int __init get_logical_cpu(int hwcpu) static int get_logical_cpu(int hwcpu)
{ {
int cpu; int cpu;
...@@ -192,9 +192,8 @@ static int __init get_logical_cpu(int hwcpu) ...@@ -192,9 +192,8 @@ static int __init get_logical_cpu(int hwcpu)
return -ENOENT; return -ENOENT;
} }
static void __init make_sensor_label(struct device_node *np, static void make_sensor_label(struct device_node *np,
struct sensor_data *sdata, struct sensor_data *sdata, const char *label)
const char *label)
{ {
u32 id; u32 id;
size_t n; size_t n;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment