]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
thermal_hwmon: Sanitize thermal_zone type
authorStefan Mavrodiev <stefan@olimex.com>
Fri, 26 Jul 2019 13:32:36 +0000 (16:32 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Nov 2019 18:04:27 +0000 (19:04 +0100)
commit0e88719cf92ed4f22083b8364d13550238c65af2
tree015211d2102375a8cb6d63fc10be85d0edad9f08
parenta48914c16f0d0e6f4b6ae7763af1c6b32ed35861
thermal_hwmon: Sanitize thermal_zone type

BugLink: https://bugs.launchpad.net/bugs/1849576
[ Upstream commit 8c7aa184281c01fc26f319059efb94725012921d ]

When calling thermal_add_hwmon_sysfs(), the device type is sanitized by
replacing '-' with '_'. However tz->type remains unsanitized. Thus
calling thermal_hwmon_lookup_by_type() returns no device. And if there is
no device, thermal_remove_hwmon_sysfs() fails with "hwmon device lookup
failed!".

The result is unregisted hwmon devices in the sysfs.

Fixes: 409ef0bacacf ("thermal_hwmon: Sanitize attribute name passed to hwmon")
Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/thermal/thermal_hwmon.c