CPUIDLE: fix 'current_governor' sysfs entry
Subsystems (2)
PATCH 1/6 CPUIDLE: fix 'current_governor' sysfs entry
This patch allows the "current_governor" sysfs entry to properly handle input terminated with '\n'.
Please Apply,
Adam
Change Summary:
sysfs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
---
drivers/cpuidle/sysfs.c +3 -6
@@ -80,16 +80,13 @@memcpy (gov_name, buf, len); gov_name[len] ='\0' ; - - len =strlen (gov_name); - -if (len && gov_name[len -1 ] =='\n' ) - gov_name[len -1 ] ='\0' ; +if (gov_name[len -1 ] =='\n' ) + gov_name[--len] ='\0' ;mutex_lock (&cpuidle_lock);list_for_each_entry (gov, &cpuidle_governors, governor_list) { -if (strlen (gov->name) == len && !strcmp (gov->name, buf)) { +if (strlen (gov->name) == len && !strcmp (gov->name, gov_name)) { ret =cpuidle_switch_governor (gov);break ; }