Skip to content

Commit

Permalink
Merge tag 'hwmon-for-v4.20-rc2' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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()
  • Loading branch information
torvalds committed Nov 7, 2018
2 parents e09d51a + e3e61f0 commit 8575877
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions drivers/hwmon/hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,17 +649,17 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
if (info[i]->config[j] & HWMON_T_INPUT) {
err = hwmon_thermal_add_sensor(dev,
hwdev, j);
if (err)
goto free_device;
if (err) {
device_unregister(hdev);
goto ida_remove;
}
}
}
}
}

return hdev;

free_device:
device_unregister(hdev);
free_hwmon:
kfree(hwdev);
ida_remove:
Expand Down
7 changes: 3 additions & 4 deletions drivers/hwmon/ibmpowernv.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static ssize_t show_label(struct device *dev, struct device_attribute *devattr,
return sprintf(buf, "%s\n", sdata->label);
}

static int __init get_logical_cpu(int hwcpu)
static int get_logical_cpu(int hwcpu)
{
int cpu;

Expand All @@ -192,9 +192,8 @@ static int __init get_logical_cpu(int hwcpu)
return -ENOENT;
}

static void __init make_sensor_label(struct device_node *np,
struct sensor_data *sdata,
const char *label)
static void make_sensor_label(struct device_node *np,
struct sensor_data *sdata, const char *label)
{
u32 id;
size_t n;
Expand Down

0 comments on commit 8575877

Please sign in to comment.