mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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: 08177f40bd ('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]>
This commit is contained in:
parent
6debce6f4e
commit
4a8e70f5d0
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue