Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ff5da97 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: Stall OS descriptor request for unsupported functions"

parents 7a5910ef 1dd2837d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1963,7 +1963,6 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
		if (cdev->use_os_string && cdev->os_desc_config &&
		    (ctrl->bRequestType & USB_TYPE_VENDOR) &&
		    ctrl->bRequest == cdev->b_vendor_code) {
			struct usb_request		*req;
			struct usb_configuration	*os_desc_cfg;
			u8				*buf;
			int				interface;
@@ -1984,6 +1983,12 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
				buf[6] = w_index;
				/* Number of ext compat interfaces */
				count = count_ext_compat(os_desc_cfg);
				/*
				 * Bailout if device does not
				 * have ext_compat interfaces.
				 */
				if (count == 0)
					break;
				buf[8] = count;
				count *= 24; /* 24 B/ext compat desc */
				count += 16; /* header */