aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2011-11-19 08:37:57 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2011-11-19 08:37:57 -0500
commit501a708f18ef911328ffd39f39738b8a7862aa8e (patch)
treef3adbf5979f9e714291cec5c2a893edbca16ba26 /kernel
parentaa9a7b11821e883a7b93ecce190881e0ea48648b (diff)
PM / Suspend: Fix bug in suspend statistics update
After commit 2a77c46de1e3dace73745015635ebbc648eca69c (PM / Suspend: Add statistics debugfs file for suspend to RAM) a missing pair of braces inside the state_store() function causes even invalid arguments to suspend to be wrongly treated as failed suspend attempts. Fix this. [rjw: Put the hash/subject of the buggy commit into the changelog.] Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 71f49fe4377e..36e0f0903c32 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -290,13 +290,14 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
290 if (*s && len == strlen(*s) && !strncmp(buf, *s, len)) 290 if (*s && len == strlen(*s) && !strncmp(buf, *s, len))
291 break; 291 break;
292 } 292 }
293 if (state < PM_SUSPEND_MAX && *s) 293 if (state < PM_SUSPEND_MAX && *s) {
294 error = enter_state(state); 294 error = enter_state(state);
295 if (error) { 295 if (error) {
296 suspend_stats.fail++; 296 suspend_stats.fail++;
297 dpm_save_failed_errno(error); 297 dpm_save_failed_errno(error);
298 } else 298 } else
299 suspend_stats.success++; 299 suspend_stats.success++;
300 }
300#endif 301#endif
301 302
302 Exit: 303 Exit: