X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=kernel%2Fpm_qos_params.c;h=645e541a45f6c9a9667c054bd7f5230ecaef67a3;hb=e799d0bce6b191de6e96e556528243c1d73303ca;hp=b7e4c362361bcf46fe34992e9bba1852dd478b71;hpb=2d813760d75150db437e40d340ae0e06ddd54a34;p=~andy%2Flinux diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index b7e4c362361..645e541a45f 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;