Commit 4a8e70f5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jiri Kosina

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: 08177f40 ('HID: uclogic: merge hid-huion driver in hid-uclogic')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarNikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
parent 6debce6f
...@@ -858,7 +858,7 @@ static int uclogic_tablet_enable(struct hid_device *hdev) ...@@ -858,7 +858,7 @@ static int uclogic_tablet_enable(struct hid_device *hdev)
for (p = drvdata->rdesc; for (p = drvdata->rdesc;
p <= drvdata->rdesc + drvdata->rsize - 4;) { p <= drvdata->rdesc + drvdata->rsize - 4;) {
if (p[0] == 0xFE && p[1] == 0xED && p[2] == 0x1D && if (p[0] == 0xFE && p[1] == 0xED && p[2] == 0x1D &&
p[3] < sizeof(params)) { p[3] < ARRAY_SIZE(params)) {
v = params[p[3]]; v = params[p[3]];
put_unaligned(cpu_to_le32(v), (s32 *)p); put_unaligned(cpu_to_le32(v), (s32 *)p);
p += 4; p += 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment