projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
HID: ft260: fix a NULL pointer dereference in ft260_i2c_write
[linux-2.6-microblaze.git]
/
drivers
/
hid
/
hid-ft260.c
diff --git
a/drivers/hid/hid-ft260.c
b/drivers/hid/hid-ft260.c
index
ac13398
..
b4f180c
100644
(file)
--- a/
drivers/hid/hid-ft260.c
+++ b/
drivers/hid/hid-ft260.c
@@
-409,6
+409,9
@@
static int ft260_i2c_write(struct ft260_device *dev, u8 addr, u8 *data,
struct ft260_i2c_write_request_report *rep =
(struct ft260_i2c_write_request_report *)dev->write_buf;
+ if (len < 1)
+ return -EINVAL;
+
rep->flag = FT260_FLAG_START;
do {