Skip to content

Commit

Permalink
ACPI sysfs.c strlen fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Vasilyev authored and lenb committed Jun 5, 2012
1 parent 7ae3098 commit 9f13265
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
{
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,
trace_debug_layer, 0);
if (result)
result = -EBUSY;
goto exit;
}

if (!strncmp(val, "disable", strlen("disable") - 1)) {
if (!strncmp(val, "disable", strlen("disable"))) {
int name = 0;
result = acpi_debug_trace((char *)&name, trace_debug_level,
trace_debug_layer, 0);
Expand Down

0 comments on commit 9f13265

Please sign in to comment.