[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <f1f0e2ac596f531c15b7b09ebeb8cfd011fffbd2.1333101989.git.len.brown@intel.com>
Date: Fri, 30 Mar 2012 06:13:24 -0400
From: Len Brown <lenb@...nel.org>
To: linux-acpi@...r.kernel.org, linux-pm@...ts.linux-foundation.org
Cc: linux-kernel@...r.kernel.org,
Amit Daniel Kachhap <amit.kachhap@...aro.org>,
Len Brown <len.brown@...el.com>
Subject: [PATCH 21/76] thermal: Fix for setting the thermal zone mode to
enable/disable
From: Amit Daniel Kachhap <amit.kachhap@...aro.org>
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@...aro.org>
Acked-by: Jean Delvare <khali@...ux-fr.org>
Signed-off-by: Len Brown <len.brown@...el.com>
---
drivers/thermal/thermal_sys.c | 4 ++--
1 file 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;
--
1.7.10.rc2.19.gfae9d
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists