Commit f1f0e2ac authored by Amit Daniel Kachhap's avatar Amit Daniel Kachhap Committed by 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: default avatarAmit Daniel Kachhap <amit.kachhap@linaro.org>
Acked-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 03ee62f0
...@@ -150,9 +150,9 @@ mode_store(struct device *dev, struct device_attribute *attr, ...@@ -150,9 +150,9 @@ mode_store(struct device *dev, struct device_attribute *attr,
if (!tz->ops->set_mode) if (!tz->ops->set_mode)
return -EPERM; return -EPERM;
if (!strncmp(buf, "enabled", sizeof("enabled"))) if (!strncmp(buf, "enabled", sizeof("enabled") - 1))
result = tz->ops->set_mode(tz, THERMAL_DEVICE_ENABLED); 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); result = tz->ops->set_mode(tz, THERMAL_DEVICE_DISABLED);
else else
result = -EINVAL; result = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment