projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03ee62f
)
thermal: Fix for setting the thermal zone mode to enable/disable
author
Amit Daniel Kachhap
<
[email protected]
>
Wed, 21 Mar 2012 11:10:01 +0000
(16:40 +0530)
committer
Len Brown
<
[email protected]
>
Thu, 22 Mar 2012 05:10:18 +0000
(
01:10
-0400)
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 <
[email protected]
>
Acked-by: Jean Delvare <
[email protected]
>
Signed-off-by: Len Brown <
[email protected]
>
drivers/thermal/thermal_sys.c
patch
|
blob
|
history
diff --git
a/drivers/thermal/thermal_sys.c
b/drivers/thermal/thermal_sys.c
index fab970d9e3e1d111372fd2c6551c262e8eb9956d..022bacb71a7ede51571a6976830859d3f674bb71 100644
(file)
--- 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;