Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56536
b: refs/heads/master
c: 8d98a69
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed May 17, 2007
1 parent 8e07c4b commit 837ca9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7925409e202a41176b729671eab6e610a54153cd
refs/heads/master: 8d98a690f58e0d6ecf424b7ca84488475cf87bd9
3 changes: 2 additions & 1 deletion trunk/kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ static ssize_t disk_store(struct kset *kset, const char *buf, size_t n)

mutex_lock(&pm_mutex);
for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) {
if (!strncmp(buf, hibernation_modes[i], len)) {
if (len == strlen(hibernation_modes[i])
&& !strncmp(buf, hibernation_modes[i], len)) {
mode = i;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,13 @@ static ssize_t state_store(struct kset *kset, const char *buf, size_t n)
len = p ? p - buf : n;

/* First, check if we are requested to hibernate */
if (!strncmp(buf, "disk", len)) {
if (len == 4 && !strncmp(buf, "disk", len)) {
error = hibernate();
return error ? error : n;
}

for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) {
if (*s && !strncmp(buf, *s, len))
if (*s && len == strlen(*s) && !strncmp(buf, *s, len))
break;
}
if (state < PM_SUSPEND_MAX && *s)
Expand Down

0 comments on commit 837ca9f

Please sign in to comment.