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

Commit 780d44d9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: composite: Add spinlock protection for usb config descriptor"

parents ba0641ba b093c259
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1673,7 +1673,9 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
			if (!gadget_is_dualspeed(gadget) ||
			    gadget->speed >= USB_SPEED_SUPER)
				break;
			spin_lock(&cdev->lock);
			device_qual(cdev);
			spin_unlock(&cdev->lock);
			value = min_t(int, w_length,
				sizeof(struct usb_qualifier_descriptor));
			break;
@@ -1683,7 +1685,9 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
				break;
			/* FALLTHROUGH */
		case USB_DT_CONFIG:
			spin_lock(&cdev->lock);
			value = config_desc(cdev, w_value);
			spin_unlock(&cdev->lock);
			if (value >= 0)
				value = min(w_length, (u16) value);
			break;