projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e87a24
)
HID: check for NULL field when setting values
author
Kees Cook
<keescook@chromium.org>
Wed, 28 Aug 2013 20:32:01 +0000
(22:32 +0200)
committer
Jiri Kosina
<jkosina@suse.cz>
Wed, 4 Sep 2013 10:05:31 +0000
(12:05 +0200)
Defensively check that the field to be worked on is not NULL.
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-core.c
patch
|
blob
|
history
diff --git
a/drivers/hid/hid-core.c
b/drivers/hid/hid-core.c
index ebf57813d31a0a6c78034301689a6ca5da766bb9..dcd60eb3d5eaf012a28c935756997f7d07372103 100644
(file)
--- a/
drivers/hid/hid-core.c
+++ b/
drivers/hid/hid-core.c
@@
-1169,7
+1169,12
@@
EXPORT_SYMBOL_GPL(hid_alloc_report_buf);
int hid_set_field(struct hid_field *field, unsigned offset, __s32 value)
{
- unsigned size = field->report_size;
+ unsigned size;
+
+ if (!field)
+ return -1;
+
+ size = field->report_size;
hid_dump_input(field->report->device, field->usage + offset, value);