summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-uclogic.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-07-29 13:16:06 +0300
committerJiri Kosina <jkosina@suse.com>2015-07-29 14:05:15 +0200
commit4a8e70f5d0d80675fc17b9ba1e62db8ca6b91775 (patch)
tree677fea5a9e3a87f27c4f80dc211da0a5be9a6123 /drivers/hid/hid-uclogic.c
parent6debce6f4e787a8eb4cec94e7afa85fb4f40db27 (diff)
HID: uclogic: fix limit in uclogic_tablet_enable()
The limit should be ARRAY_SIZE(params) (5 elements) here instead of sizeof(params) (20 bytes). Fixes: 08177f40bd00 ('HID: uclogic: merge hid-huion driver in hid-uclogic') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'drivers/hid/hid-uclogic.c')
-rw-r--r--drivers/hid/hid-uclogic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-uclogic.c b/drivers/hid/hid-uclogic.c
index 94167310e15a..b905d501e752 100644
--- a/drivers/hid/hid-uclogic.c
+++ b/drivers/hid/hid-uclogic.c
@@ -858,7 +858,7 @@ static int uclogic_tablet_enable(struct hid_device *hdev)
for (p = drvdata->rdesc;
p <= drvdata->rdesc + drvdata->rsize - 4;) {
if (p[0] == 0xFE && p[1] == 0xED && p[2] == 0x1D &&
- p[3] < sizeof(params)) {
+ p[3] < ARRAY_SIZE(params)) {
v = params[p[3]];
put_unaligned(cpu_to_le32(v), (s32 *)p);
p += 4;