浏览代码

ACPI sysfs.c strlen fix

Current code is ignoring the last character of "enable" and "disable"
in comparisons.

https://bugzilla.kernel.org/show_bug.cgi?id=33732

Signed-off-by: Len Brown <len.brown@intel.com>
Pavel Vasilyev 13 年之前
父节点
当前提交
9f132652d9
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/acpi/sysfs.c

+ 2 - 2
drivers/acpi/sysfs.c

@@ -173,7 +173,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
 {
 {
 	int result = 0;
 	int result = 0;
 
 
-	if (!strncmp(val, "enable", strlen("enable") - 1)) {
+	if (!strncmp(val, "enable", strlen("enable"))) {
 		result = acpi_debug_trace(trace_method_name, trace_debug_level,
 		result = acpi_debug_trace(trace_method_name, trace_debug_level,
 					  trace_debug_layer, 0);
 					  trace_debug_layer, 0);
 		if (result)
 		if (result)
@@ -181,7 +181,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
 		goto exit;
 		goto exit;
 	}
 	}
 
 
-	if (!strncmp(val, "disable", strlen("disable") - 1)) {
+	if (!strncmp(val, "disable", strlen("disable"))) {
 		int name = 0;
 		int name = 0;
 		result = acpi_debug_trace((char *)&name, trace_debug_level,
 		result = acpi_debug_trace((char *)&name, trace_debug_level,
 					  trace_debug_layer, 0);
 					  trace_debug_layer, 0);