diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-11 15:50:53 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-11 15:50:53 -0700 |
commit | 84e1d836ef0759a152578a961894824bde89596f (patch) | |
tree | 47c439bfdc9e5ea91f9a71235d336257555fad78 /kernel/pm_qos_params.c | |
parent | 20f4cad6b247160055915db4f4aaeda82e6c50ed (diff) | |
parent | 6715045ddc7472a22be5e49d4047d2d89b391f45 (diff) | |
download | linux-stable-84e1d836ef0759a152578a961894824bde89596f.tar.gz linux-stable-84e1d836ef0759a152578a961894824bde89596f.tar.bz2 linux-stable-84e1d836ef0759a152578a961894824bde89596f.zip |
Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
PM / Hibernate: Avoid hitting OOM during preallocation of memory
PM QoS: Correct pr_debug() misuse and improve parameter checks
PM: Prevent waiting forever on asynchronous resume after failing suspend
Diffstat (limited to 'kernel/pm_qos_params.c')
-rw-r--r-- | kernel/pm_qos_params.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index b7e4c362361b..645e541a45f6 100644 --- a/kernel/pm_qos_params.c +++ b/kernel/pm_qos_params.c @@ -389,10 +389,12 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, } else if (count == 11) { /* len('0x12345678/0') */ if (copy_from_user(ascii_value, buf, 11)) return -EFAULT; + if (strlen(ascii_value) != 10) + return -EINVAL; x = sscanf(ascii_value, "%x", &value); if (x != 1) return -EINVAL; - pr_debug(KERN_ERR "%s, %d, 0x%x\n", ascii_value, x, value); + pr_debug("%s, %d, 0x%x\n", ascii_value, x, value); } else return -EINVAL; |