[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180917211717.061300384@linuxfoundation.org>
Date: Tue, 18 Sep 2018 00:42:37 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Marc Zyngier <marc.zyngier@....com>,
Enric Balletbo i Serra <enric.balletbo@...labora.com>,
Eduardo Valentin <edubezval@...il.com>,
Sasha Levin <alexander.levin@...rosoft.com>
Subject: [PATCH 4.18 127/158] thermal_hwmon: Sanitize attribute name passed to hwmon
4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <marc.zyngier@....com>
[ Upstream commit 409ef0bacacf72c51cc876349ae3fdf7cf726d47 ]
My Chromebook Plus (kevin) is spitting the following at boot time:
(NULL device *): hwmon: 'sbs-9-000b' is not a valid name attribute, please fix
Clearly, __hwmon_device_register is unhappy about the property name.
Some investigation reveals that thermal_add_hwmon_sysfs doesn't
sanitize the name of the attribute.
In order to keep it quiet, let's replace '-' with '_' in hwmon->type
This is consistent with what iio-hwmon does since b92fe9e3379c8.
Signed-off-by: Marc Zyngier <marc.zyngier@....com>
Tested-by: Enric Balletbo i Serra <enric.balletbo@...labora.com>
Signed-off-by: Eduardo Valentin <edubezval@...il.com>
Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/thermal/thermal_hwmon.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -142,6 +142,7 @@ int thermal_add_hwmon_sysfs(struct therm
INIT_LIST_HEAD(&hwmon->tz_list);
strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH);
+ strreplace(hwmon->type, '-', '_');
hwmon->device = hwmon_device_register_with_info(NULL, hwmon->type,
hwmon, NULL, NULL);
if (IS_ERR(hwmon->device)) {
Powered by blists - more mailing lists