diff options
Diffstat (limited to 'kernel/power/disk.c')
-rw-r--r-- | kernel/power/disk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index b5f0543ed84d..f445b9cd60fb 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
@@ -416,7 +416,8 @@ static ssize_t disk_store(struct kset *kset, const char *buf, size_t n) | |||
416 | 416 | ||
417 | mutex_lock(&pm_mutex); | 417 | mutex_lock(&pm_mutex); |
418 | for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) { | 418 | for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) { |
419 | if (!strncmp(buf, hibernation_modes[i], len)) { | 419 | if (len == strlen(hibernation_modes[i]) |
420 | && !strncmp(buf, hibernation_modes[i], len)) { | ||
420 | mode = i; | 421 | mode = i; |
421 | break; | 422 | break; |
422 | } | 423 | } |