projects
/
platform
/
kernel
/
kernel-mfld-blackbay.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
066408c
)
Staging: android: timed_gpio: Properly discard invalid timeout values.
author
Mike Lockwood
<lockwood@android.com>
Sat, 17 Apr 2010 16:01:35 +0000
(12:01 -0400)
committer
mgross
<mark.gross@intel.com>
Wed, 9 Nov 2011 20:05:15 +0000
(12:05 -0800)
The timed output device never previously checked the return value of sscanf,
resulting in an uninitialized int being passed to enable() if input value
was invalid.
Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers/staging/android/timed_output.c
patch
|
blob
|
history
diff --git
a/drivers/staging/android/timed_output.c
b/drivers/staging/android/timed_output.c
index
62e7918
..
f373422
100644
(file)
--- a/
drivers/staging/android/timed_output.c
+++ b/
drivers/staging/android/timed_output.c
@@
-41,7
+41,9
@@
static ssize_t enable_store(
struct timed_output_dev *tdev = dev_get_drvdata(dev);
int value;
- sscanf(buf, "%d", &value);
+ if (sscanf(buf, "%d", &value) != 1)
+ return -EINVAL;
+
tdev->enable(tdev, value);
return size;