mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
hwmon: Register thermal zone only if 'dev' parameter was provided
Rgistering a thermal zone uses devm_kzalloc(), which requires a pointer to the parent device. Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
This commit is contained in:
parent
74d3b64197
commit
319fe15988
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue