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

Commit 31b6a8be 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: Ignore the second set_config from the host"

parents 7d857e56 6aee52f7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -610,6 +610,16 @@ static int set_config(struct usb_composite_dev *cdev,
	unsigned		power = gadget_is_otg(gadget) ? 8 : 100;
	int			tmp;

	/*
	 * ignore 2nd time SET_CONFIGURATION
	 * only for same config value twice.
	 */
	if (cdev->config && (cdev->config->bConfigurationValue == number)) {
		DBG(cdev, "already in the same config with value %d\n",
				number);
		return 0;
	}

	if (number) {
		list_for_each_entry(c, &cdev->configs, list) {
			if (c->bConfigurationValue == number) {