mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
usb: gadget: composite: USB_GET_CONFIGURATION must return 0 in unconfigured state.
Change-Id: I5212ca9990308d0c4ae6a55c60cba42d6b0e4fee Signed-off-by: Oleg Matcovschi <olegmatcovsky@gmail.com>
This commit is contained in:
parent
7d5250301d
commit
e67dd1611d
|
|
@ -1013,12 +1013,11 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
|
|||
case USB_REQ_GET_CONFIGURATION:
|
||||
if (ctrl->bRequestType != USB_DIR_IN)
|
||||
goto unknown;
|
||||
if (cdev->config) {
|
||||
if (cdev->config)
|
||||
*(u8 *)req->buf = cdev->config->bConfigurationValue;
|
||||
value = min(w_length, (u16) 1);
|
||||
} else {
|
||||
else
|
||||
*(u8 *)req->buf = 0;
|
||||
}
|
||||
value = min(w_length, (u16) 1);
|
||||
break;
|
||||
|
||||
/* function drivers must handle get/set altsetting; if there's
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user