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>
This commit is contained in:
parent
03ee62f0b9
commit
f1f0e2ac59
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user