From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030852Ab2CULK0 (ORCPT ); Wed, 21 Mar 2012 07:10:26 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:57943 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932157Ab2CULKY (ORCPT ); Wed, 21 Mar 2012 07:10:24 -0400 From: Amit Daniel Kachhap To: linux-pm@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, lenb@kernel.org, khali@linux-fr.org, linaro-dev@lists.linaro.org, amit.kachhap@linaro.org, patches@linaro.org Subject: [PATCH] thermal: Fix for setting the thermal zone mode to enable/disable Date: Wed, 21 Mar 2012 16:40:01 +0530 Message-Id: <1332328201-21191-1-git-send-email-amit.kachhap@linaro.org> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- drivers/thermal/thermal_sys.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 220ce7e..96da1af 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c @@ -152,9 +152,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.1