提交 f1f0e2ac 编写于 作者: A Amit Daniel Kachhap 提交者: Len Brown

thermal: Fix for setting the thermal zone mode to enable/disable

Basically without this patch changing the mode of thermal zone
is not possible as wrong string size is passed to strncmp.
Signed-off-by: NAmit Daniel Kachhap <amit.kachhap@linaro.org>
Acked-by: NJean Delvare <khali@linux-fr.org>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 03ee62f0
......@@ -150,9 +150,9 @@ mode_store(struct device *dev, struct device_attribute *attr,
if (!tz->ops->set_mode)
return -EPERM;
if (!strncmp(buf, "enabled", sizeof("enabled")))
if (!strncmp(buf, "enabled", sizeof("enabled") - 1))
result = tz->ops->set_mode(tz, THERMAL_DEVICE_ENABLED);
else if (!strncmp(buf, "disabled", sizeof("disabled")))
else if (!strncmp(buf, "disabled", sizeof("disabled") - 1))
result = tz->ops->set_mode(tz, THERMAL_DEVICE_DISABLED);
else
result = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册