Skip to content

Commit 4a8e70f

Browse files
Dan CarpenterJiri Kosina
authored andcommitted
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: 08177f4 ('HID: uclogic: merge hid-huion driver in hid-uclogic') Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 6debce6 commit 4a8e70f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-uclogic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ static int uclogic_tablet_enable(struct hid_device *hdev)
858858
for (p = drvdata->rdesc;
859859
p <= drvdata->rdesc + drvdata->rsize - 4;) {
860860
if (p[0] == 0xFE && p[1] == 0xED && p[2] == 0x1D &&
861-
p[3] < sizeof(params)) {
861+
p[3] < ARRAY_SIZE(params)) {
862862
v = params[p[3]];
863863
put_unaligned(cpu_to_le32(v), (s32 *)p);
864864
p += 4;

0 commit comments

Comments
 (0)