Skip to content

Commit f71c468

Browse files
Meng Dongyangrkhuangtao
authored andcommitted
usb: fix error of reference count of ep
The reference count of endpoints is same with the interface number in the quirk case of USB_QUIRK_AUTO_SUSPEND. This will result in a break of unregister interface cycle. As a result, the device only unregister the first interface when disconnect. This patch use "j" instead of "i" to solve this problem. Fixes: f092c99 ("USB: core: flush pending URBs for unusual USB3 core when disable device") Change-Id: I7aba63c0d38768cb956394a702bb61ae3f3250ba Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
1 parent d0c0269 commit f71c468

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/usb/core/message.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf,
11481148
*/
11491149
void usb_disable_device(struct usb_device *dev, int skip_ep0)
11501150
{
1151-
int i;
1151+
int i, j;
11521152
struct usb_hcd *hcd = bus_to_hcd(dev->bus);
11531153

11541154
/* getting rid of interfaces will disconnect
@@ -1186,11 +1186,11 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
11861186
*/
11871187
if (hcd->self.root_hub->quirks &
11881188
USB_QUIRK_AUTO_SUSPEND) {
1189-
for (i = skip_ep0; i < 16; ++i) {
1189+
for (j = skip_ep0; j < 16; ++j) {
11901190
usb_hcd_flush_endpoint(dev,
1191-
dev->ep_out[i]);
1191+
dev->ep_out[j]);
11921192
usb_hcd_flush_endpoint(dev,
1193-
dev->ep_in[i]);
1193+
dev->ep_in[j]);
11941194
}
11951195
}
11961196

0 commit comments

Comments
 (0)