summaryrefslogtreecommitdiff
path: root/drivers/thermal/thermal_sys.c
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.kachhap@linaro.org>2012-03-21 11:10:01 (GMT)
committerLen Brown <len.brown@intel.com>2012-03-22 05:10:18 (GMT)
commitf1f0e2ac596f531c15b7b09ebeb8cfd011fffbd2 (patch)
tree8020e9f9c8f47880b37b0745b501d79ecb09970c /drivers/thermal/thermal_sys.c
parent03ee62f0b9919535a1be02f72fe8153255a7fda0 (diff)
downloadlinux-f1f0e2ac596f531c15b7b09ebeb8cfd011fffbd2.tar.xz
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: Amit Daniel Kachhap <amit.kachhap@linaro.org> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/thermal/thermal_sys.c')
-rw-r--r--drivers/thermal/thermal_sys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index fab970d..022bacb 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -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;