Skip to content

Commit

Permalink
usb: gadget: f_hid: idle uses the highest byte for duration
Browse files Browse the repository at this point in the history
commit fa20bad upstream.

SET_IDLE value must be shifted 8 bits to the right to get duration.
This confirmed by USBCV test.

Fixes: afcff6d ("usb: gadget: f_hid: added GET_IDLE and SET_IDLE handlers")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Maxim Devaev <mdevaev@gmail.com>
Link: https://lore.kernel.org/r/20210727185800.43796-1-mdevaev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
mdevaev authored and gregkh committed Aug 12, 2021
1 parent 825ac3f commit 1f20155
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/function/f_hid.c
Expand Up @@ -573,7 +573,7 @@ static int hidg_setup(struct usb_function *f,
| HID_REQ_SET_IDLE):
VDBG(cdev, "set_idle\n");
length = 0;
hidg->idle = value;
hidg->idle = value >> 8;
goto respond;
break;

Expand Down

0 comments on commit 1f20155

Please sign in to comment.