projects
/
platform
/
kernel
/
linux-exynos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74d3b64
)
hwmon: Register thermal zone only if 'dev' parameter was provided
author
Guenter Roeck
<linux@roeck-us.net>
Tue, 31 Jan 2017 11:56:08 +0000
(
03:56
-0800)
committer
Guenter Roeck
<linux@roeck-us.net>
Tue, 31 Jan 2017 11:56:08 +0000
(
03:56
-0800)
Rgistering a thermal zone uses devm_kzalloc(), which requires
a pointer to the parent device.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/hwmon.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/hwmon.c
b/drivers/hwmon/hwmon.c
index
9a02c45
..
28375d5
100644
(file)
--- a/
drivers/hwmon/hwmon.c
+++ b/
drivers/hwmon/hwmon.c
@@
-608,7
+608,7
@@
__hwmon_device_register(struct device *dev, const char *name, void *drvdata,
if (err)
goto free_hwmon;
- if (chip && chip->ops->read &&
+ if (
dev &&
chip && chip->ops->read &&
chip->info[0]->type == hwmon_chip &&
(chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) {
const struct hwmon_channel_info **info = chip->info;