projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
152e1d5
)
PM QoS: Correct pr_debug() misuse and improve parameter checks
author
mark gross
<
[email protected]
>
Thu, 9 Sep 2010 21:20:09 +0000
(23:20 +0200)
committer
Rafael J. Wysocki
<
[email protected]
>
Fri, 10 Sep 2010 22:53:05 +0000
(
00:53
+0200)
Correct some pr_debug() misuse and add a stronger parameter check to
pm_qos_write() for the ASCII hex value case. Thanks to Dan Carpenter
for pointing out the problem!
Signed-off-by: mark gross <
[email protected]
>
Signed-off-by: Rafael J. Wysocki <
[email protected]
>
kernel/pm_qos_params.c
patch
|
blob
|
history
diff --git
a/kernel/pm_qos_params.c
b/kernel/pm_qos_params.c
index b7e4c362361bcf46fe34992e9bba1852dd478b71..645e541a45f6c9a9667c054bd7f5230ecaef67a3 100644
(file)
--- 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;