hwmon: Register thermal zone only if 'dev' parameter was provided
authorGuenter Roeck <linux@roeck-us.net>
Tue, 31 Jan 2017 11:56:08 +0000 (03:56 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 31 Jan 2017 11:56:08 +0000 (03:56 -0800)
commit319fe159889a06b47a2621a1201c813502b7a842
treef704f481f2e8c3787664553fd24332c8311273a4
parent74d3b6419772e49563877b9a3c502b763d24b075
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 <dan.carpenter@oracle.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/hwmon.c