From 7d35d7d4ae0ebe2c1cfaf7defedff7261bbfa30d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 29 Jul 2015 18:49:46 -0700 Subject: [PATCH] 3.14-stable patches added patches: usb-cp210x-add-id-for-aruba-networks-controllers.patch usb-devio-fix-a-condition-in-async_completed.patch usb-dwc3-gadget-return-error-if-command-sent-to-depcmd-register-fails.patch usb-dwc3-gadget-return-error-if-command-sent-to-dgcmd-register-fails.patch usb-dwc3-reset-the-transfer-resource-index-on-set_interface.patch usb-musb-host-rely-on-port_mode-to-call-musb_start.patch usb-option-add-2020-4000-id.patch usb-serial-destroy-serial_minors-idr-on-module-exit.patch usb-xhci-bugfix-for-null-pointer-deference-in-xhci_endpoint_init-function.patch --- queue-3.14/series | 9 +++ ...dd-id-for-aruba-networks-controllers.patch | 30 ++++++++ ...o-fix-a-condition-in-async_completed.patch | 33 ++++++++ ...ommand-sent-to-depcmd-register-fails.patch | 32 ++++++++ ...command-sent-to-dgcmd-register-fails.patch | 32 ++++++++ ...sfer-resource-index-on-set_interface.patch | 56 ++++++++++++++ ...rely-on-port_mode-to-call-musb_start.patch | 41 ++++++++++ queue-3.14/usb-option-add-2020-4000-id.patch | 45 +++++++++++ ...roy-serial_minors-idr-on-module-exit.patch | 75 +++++++++++++++++++ ...rence-in-xhci_endpoint_init-function.patch | 57 ++++++++++++++ 10 files changed, 410 insertions(+) create mode 100644 queue-3.14/usb-cp210x-add-id-for-aruba-networks-controllers.patch create mode 100644 queue-3.14/usb-devio-fix-a-condition-in-async_completed.patch create mode 100644 queue-3.14/usb-dwc3-gadget-return-error-if-command-sent-to-depcmd-register-fails.patch create mode 100644 queue-3.14/usb-dwc3-gadget-return-error-if-command-sent-to-dgcmd-register-fails.patch create mode 100644 queue-3.14/usb-dwc3-reset-the-transfer-resource-index-on-set_interface.patch create mode 100644 queue-3.14/usb-musb-host-rely-on-port_mode-to-call-musb_start.patch create mode 100644 queue-3.14/usb-option-add-2020-4000-id.patch create mode 100644 queue-3.14/usb-serial-destroy-serial_minors-idr-on-module-exit.patch create mode 100644 queue-3.14/usb-xhci-bugfix-for-null-pointer-deference-in-xhci_endpoint_init-function.patch diff --git a/queue-3.14/series b/queue-3.14/series index 9605304c46f..d07fa22e420 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -56,3 +56,12 @@ asoc-wm8903-fix-define-for-wm8903_vmid_res_250k.patch asoc-wm8960-the-enum-of-dac-polarity-should-be-wm8960_enum.patch libata-add-ata_horkage_broken_fpdma_aa-quirk-for-hp-250gb-sata-disk-vb0250eaver.patch libata-increase-the-timeout-when-setting-transfer-mode.patch +usb-dwc3-gadget-return-error-if-command-sent-to-dgcmd-register-fails.patch +usb-dwc3-gadget-return-error-if-command-sent-to-depcmd-register-fails.patch +usb-dwc3-reset-the-transfer-resource-index-on-set_interface.patch +usb-devio-fix-a-condition-in-async_completed.patch +usb-musb-host-rely-on-port_mode-to-call-musb_start.patch +usb-cp210x-add-id-for-aruba-networks-controllers.patch +usb-option-add-2020-4000-id.patch +usb-serial-destroy-serial_minors-idr-on-module-exit.patch +usb-xhci-bugfix-for-null-pointer-deference-in-xhci_endpoint_init-function.patch diff --git a/queue-3.14/usb-cp210x-add-id-for-aruba-networks-controllers.patch b/queue-3.14/usb-cp210x-add-id-for-aruba-networks-controllers.patch new file mode 100644 index 00000000000..9de14ee6cfb --- /dev/null +++ b/queue-3.14/usb-cp210x-add-id-for-aruba-networks-controllers.patch @@ -0,0 +1,30 @@ +From f98a7aa81eeeadcad25665c3501c236d531d4382 Mon Sep 17 00:00:00 2001 +From: Peter Sanford +Date: Thu, 25 Jun 2015 17:40:05 -0700 +Subject: USB: cp210x: add ID for Aruba Networks controllers + +From: Peter Sanford + +commit f98a7aa81eeeadcad25665c3501c236d531d4382 upstream. + +Add the USB serial console device ID for Aruba Networks 7xxx series +controllers which have a USB port for their serial console. + +Signed-off-by: Peter Sanford +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/cp210x.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -187,6 +187,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x1FB9, 0x0602) }, /* Lake Shore Model 648 Magnet Power Supply */ + { USB_DEVICE(0x1FB9, 0x0700) }, /* Lake Shore Model 737 VSM Controller */ + { USB_DEVICE(0x1FB9, 0x0701) }, /* Lake Shore Model 776 Hall Matrix */ ++ { USB_DEVICE(0x2626, 0xEA60) }, /* Aruba Networks 7xxx USB Serial Console */ + { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ + { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */ + { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */ diff --git a/queue-3.14/usb-devio-fix-a-condition-in-async_completed.patch b/queue-3.14/usb-devio-fix-a-condition-in-async_completed.patch new file mode 100644 index 00000000000..94dcca7b464 --- /dev/null +++ b/queue-3.14/usb-devio-fix-a-condition-in-async_completed.patch @@ -0,0 +1,33 @@ +From 83ed07c5db71bc02bd646d6eb60b48908235cdf9 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Mon, 18 May 2015 15:29:51 +0300 +Subject: USB: devio: fix a condition in async_completed() + +From: Dan Carpenter + +commit 83ed07c5db71bc02bd646d6eb60b48908235cdf9 upstream. + +Static checkers complain that the current condition is never true. It +seems pretty likely that it's a typo and "URB" was intended instead of +"USB". + +Fixes: 3d97ff63f899 ('usbdevfs: Use scatter-gather lists for large bulk transfers') +Signed-off-by: Dan Carpenter +Acked-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/devio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/core/devio.c ++++ b/drivers/usb/core/devio.c +@@ -513,7 +513,7 @@ static void async_completed(struct urb * + snoop(&urb->dev->dev, "urb complete\n"); + snoop_urb(urb->dev, as->userurb, urb->pipe, urb->actual_length, + as->status, COMPLETE, NULL, 0); +- if ((urb->transfer_flags & URB_DIR_MASK) == USB_DIR_IN) ++ if ((urb->transfer_flags & URB_DIR_MASK) == URB_DIR_IN) + snoop_urb_data(urb, urb->actual_length); + + if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET && diff --git a/queue-3.14/usb-dwc3-gadget-return-error-if-command-sent-to-depcmd-register-fails.patch b/queue-3.14/usb-dwc3-gadget-return-error-if-command-sent-to-depcmd-register-fails.patch new file mode 100644 index 00000000000..3a3b23dfe28 --- /dev/null +++ b/queue-3.14/usb-dwc3-gadget-return-error-if-command-sent-to-depcmd-register-fails.patch @@ -0,0 +1,32 @@ +From 76e838c9f7765f9a6205b4d558d75a66104bc60d Mon Sep 17 00:00:00 2001 +From: Subbaraya Sundeep Bhatta +Date: Thu, 21 May 2015 15:46:48 +0530 +Subject: usb: dwc3: gadget: return error if command sent to DEPCMD register fails + +From: Subbaraya Sundeep Bhatta + +commit 76e838c9f7765f9a6205b4d558d75a66104bc60d upstream. + +We need to return error to caller if command is not sent to +controller succesfully. + +Signed-off-by: Subbaraya Sundeep Bhatta +Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver) +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/gadget.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -337,6 +337,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 + if (!(reg & DWC3_DEPCMD_CMDACT)) { + dev_vdbg(dwc->dev, "Command Complete --> %d\n", + DWC3_DEPCMD_STATUS(reg)); ++ if (DWC3_DEPCMD_STATUS(reg)) ++ return -EINVAL; + return 0; + } + diff --git a/queue-3.14/usb-dwc3-gadget-return-error-if-command-sent-to-dgcmd-register-fails.patch b/queue-3.14/usb-dwc3-gadget-return-error-if-command-sent-to-dgcmd-register-fails.patch new file mode 100644 index 00000000000..a69ee56e69d --- /dev/null +++ b/queue-3.14/usb-dwc3-gadget-return-error-if-command-sent-to-dgcmd-register-fails.patch @@ -0,0 +1,32 @@ +From 891b1dc022955d36cf4c0f42d383226a930db7ed Mon Sep 17 00:00:00 2001 +From: Subbaraya Sundeep Bhatta +Date: Thu, 21 May 2015 15:46:47 +0530 +Subject: usb: dwc3: gadget: return error if command sent to DGCMD register fails + +From: Subbaraya Sundeep Bhatta + +commit 891b1dc022955d36cf4c0f42d383226a930db7ed upstream. + +We need to return error to caller if command is not sent to +controller succesfully. + +Signed-off-by: Subbaraya Sundeep Bhatta +Fixes: b09bb64239c8 (usb: dwc3: gadget: implement Global Command support) +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/gadget.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -299,6 +299,8 @@ int dwc3_send_gadget_generic_command(str + if (!(reg & DWC3_DGCMD_CMDACT)) { + dev_vdbg(dwc->dev, "Command Complete --> %d\n", + DWC3_DGCMD_STATUS(reg)); ++ if (DWC3_DGCMD_STATUS(reg)) ++ return -EINVAL; + return 0; + } + diff --git a/queue-3.14/usb-dwc3-reset-the-transfer-resource-index-on-set_interface.patch b/queue-3.14/usb-dwc3-reset-the-transfer-resource-index-on-set_interface.patch new file mode 100644 index 00000000000..40f081f1c2a --- /dev/null +++ b/queue-3.14/usb-dwc3-reset-the-transfer-resource-index-on-set_interface.patch @@ -0,0 +1,56 @@ +From aebda618718157a69c0dc0adb978d69bc2b8723c Mon Sep 17 00:00:00 2001 +From: John Youn +Date: Mon, 17 Sep 2001 00:00:00 -0700 +Subject: usb: dwc3: Reset the transfer resource index on SET_INTERFACE + +From: John Youn + +commit aebda618718157a69c0dc0adb978d69bc2b8723c upstream. + +This fixes an issue introduced in commit b23c843992b6 (usb: dwc3: +gadget: fix DEPSTARTCFG for non-EP0 EPs) that made sure we would +only use DEPSTARTCFG once per SetConfig. + +The trick is that we should use one DEPSTARTCFG per SetConfig *OR* +SetInterface. SetInterface was completely missed from the original +patch. + +This problem became aparent after commit 76e838c9f776 (usb: dwc3: +gadget: return error if command sent to DEPCMD register fails) +added checking of the return status of device endpoint commands. + +'Set Endpoint Transfer Resource' command was caught failing +occasionally. This is because the Transfer Resource +Index was not getting reset during a SET_INTERFACE request. + +Finally, to fix the issue, was we have to do is make sure that +our start_config_issued flag gets reset whenever we receive a +SetInterface request. + +To verify the problem (and its fix), all we have to do is run +test 9 from testusb with 'testusb -t 9 -s 2048 -a -c 5000'. + +Tested-by: Huang Rui +Tested-by: Subbaraya Sundeep Bhatta +Fixes: b23c843992b6 (usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPs) +Signed-off-by: John Youn +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/ep0.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/dwc3/ep0.c ++++ b/drivers/usb/dwc3/ep0.c +@@ -707,6 +707,10 @@ static int dwc3_ep0_std_request(struct d + dev_vdbg(dwc->dev, "USB_REQ_SET_ISOCH_DELAY\n"); + ret = dwc3_ep0_set_isoch_delay(dwc, ctrl); + break; ++ case USB_REQ_SET_INTERFACE: ++ dwc3_trace(trace_dwc3_ep0, "USB_REQ_SET_INTERFACE"); ++ dwc->start_config_issued = false; ++ /* Fall through */ + default: + dev_vdbg(dwc->dev, "Forwarding to gadget driver\n"); + ret = dwc3_ep0_delegate_req(dwc, ctrl); diff --git a/queue-3.14/usb-musb-host-rely-on-port_mode-to-call-musb_start.patch b/queue-3.14/usb-musb-host-rely-on-port_mode-to-call-musb_start.patch new file mode 100644 index 00000000000..3d487cbd01c --- /dev/null +++ b/queue-3.14/usb-musb-host-rely-on-port_mode-to-call-musb_start.patch @@ -0,0 +1,41 @@ +From be9d39881fc4fa39a64b6eed6bab5d9ee5125344 Mon Sep 17 00:00:00 2001 +From: Felipe Balbi +Date: Tue, 2 Jun 2015 13:03:36 -0500 +Subject: usb: musb: host: rely on port_mode to call musb_start() + +From: Felipe Balbi + +commit be9d39881fc4fa39a64b6eed6bab5d9ee5125344 upstream. + +Currently, we're calling musb_start() twice for DRD ports +in some situations. This has been observed to cause enumeration +issues after suspend/resume cycles with AM335x. + +In order to fix the problem, we just have to fix the check +on musb_has_gadget() so that it only returns true if +current mode is Host and ignore the fact that we have or +not a gadget driver loaded. + +Fixes: ae44df2e21b5 (usb: musb: call musb_start() only once in OTG mode) +Cc: Sebastian Andrzej Siewior +Tested-by: Sekhar Nori +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/musb/musb_virthub.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/usb/musb/musb_virthub.c ++++ b/drivers/usb/musb/musb_virthub.c +@@ -273,9 +273,7 @@ static int musb_has_gadget(struct musb * + #ifdef CONFIG_USB_MUSB_HOST + return 1; + #else +- if (musb->port_mode == MUSB_PORT_MODE_HOST) +- return 1; +- return musb->g.dev.driver != NULL; ++ return musb->port_mode == MUSB_PORT_MODE_HOST; + #endif + } + diff --git a/queue-3.14/usb-option-add-2020-4000-id.patch b/queue-3.14/usb-option-add-2020-4000-id.patch new file mode 100644 index 00000000000..c60b54fdd50 --- /dev/null +++ b/queue-3.14/usb-option-add-2020-4000-id.patch @@ -0,0 +1,45 @@ +From f6d7fb37f92622479ef6da604f27561f5045ba1e Mon Sep 17 00:00:00 2001 +From: Claudio Cappelli +Date: Wed, 10 Jun 2015 20:38:30 +0200 +Subject: USB: option: add 2020:4000 ID + +From: Claudio Cappelli + +commit f6d7fb37f92622479ef6da604f27561f5045ba1e upstream. + +Add device Olivetti Olicard 300 (Network Connect: MT6225) - IDs 2020:4000. + +T: Bus=01 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 10 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=2020 ProdID=4000 Rev=03.00 +S: Manufacturer=Network Connect +S: Product=MT6225 +C: #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim +I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim +I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=option +I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +I: If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage + +Signed-off-by: Claudio Cappelli +Suggested-by: Lars Melin +[johan: amend commit message with devices info ] +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/option.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -1755,6 +1755,7 @@ static const struct usb_device_id option + { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ ++ { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) }, /* OLICARD300 - MT6225 */ + { USB_DEVICE(INOVIA_VENDOR_ID, INOVIA_SEW858) }, + { USB_DEVICE(VIATELECOM_VENDOR_ID, VIATELECOM_PRODUCT_CDS7) }, + { } /* Terminating entry */ diff --git a/queue-3.14/usb-serial-destroy-serial_minors-idr-on-module-exit.patch b/queue-3.14/usb-serial-destroy-serial_minors-idr-on-module-exit.patch new file mode 100644 index 00000000000..ee86b587472 --- /dev/null +++ b/queue-3.14/usb-serial-destroy-serial_minors-idr-on-module-exit.patch @@ -0,0 +1,75 @@ +From d23f47d4927fd2f61b3a754d83c7bcec215b5cfe Mon Sep 17 00:00:00 2001 +From: Johannes Thumshirn +Date: Wed, 8 Jul 2015 17:26:37 +0200 +Subject: USB: serial: Destroy serial_minors IDR on module exit + +From: Johannes Thumshirn + +commit d23f47d4927fd2f61b3a754d83c7bcec215b5cfe upstream. + +Destroy serial_minors IDR on module exit, reclaiming the allocated memory. + +This was detected by the following semantic patch (written by Luis +Rodriguez ) + + +@ defines_module_init @ +declarer name module_init, module_exit; +declarer name DEFINE_IDR; +identifier init; +@@ + +module_init(init); + +@ defines_module_exit @ +identifier exit; +@@ + +module_exit(exit); + +@ declares_idr depends on defines_module_init && defines_module_exit @ +identifier idr; +@@ + +DEFINE_IDR(idr); + +@ on_exit_calls_destroy depends on declares_idr && defines_module_exit @ +identifier declares_idr.idr, defines_module_exit.exit; +@@ + +exit(void) +{ + ... + idr_destroy(&idr); + ... +} + +@ missing_module_idr_destroy depends on declares_idr && defines_module_exit && !on_exit_calls_destroy @ +identifier declares_idr.idr, defines_module_exit.exit; +@@ + +exit(void) +{ + ... + +idr_destroy(&idr); +} + + +Signed-off-by: Johannes Thumshirn +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/usb-serial.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/usb-serial.c ++++ b/drivers/usb/serial/usb-serial.c +@@ -1300,6 +1300,7 @@ static void __exit usb_serial_exit(void) + tty_unregister_driver(usb_serial_tty_driver); + put_tty_driver(usb_serial_tty_driver); + bus_unregister(&usb_serial_bus_type); ++ idr_destroy(&serial_minors); + } + + diff --git a/queue-3.14/usb-xhci-bugfix-for-null-pointer-deference-in-xhci_endpoint_init-function.patch b/queue-3.14/usb-xhci-bugfix-for-null-pointer-deference-in-xhci_endpoint_init-function.patch new file mode 100644 index 00000000000..f7a73806840 --- /dev/null +++ b/queue-3.14/usb-xhci-bugfix-for-null-pointer-deference-in-xhci_endpoint_init-function.patch @@ -0,0 +1,57 @@ +From 3496810663922617d4b706ef2780c279252ddd6a Mon Sep 17 00:00:00 2001 +From: AMAN DEEP +Date: Tue, 21 Jul 2015 17:20:27 +0300 +Subject: usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() function + +From: AMAN DEEP + +commit 3496810663922617d4b706ef2780c279252ddd6a upstream. + +virt_dev->num_cached_rings counts on freed ring and is not updated +correctly. In xhci_free_or_cache_endpoint_ring() function, the free ring +is added into cache and then num_rings_cache is incremented as below: + virt_dev->ring_cache[rings_cached] = + virt_dev->eps[ep_index].ring; + virt_dev->num_rings_cached++; +here, free ring pointer is added to a current index and then +index is incremented. +So current index always points to empty location in the ring cache. +For getting available free ring, current index should be decremented +first and then corresponding ring buffer value should be taken from ring +cache. + +But In function xhci_endpoint_init(), the num_rings_cached index is +accessed before decrement. + virt_dev->eps[ep_index].new_ring = + virt_dev->ring_cache[virt_dev->num_rings_cached]; + virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL; + virt_dev->num_rings_cached--; +This is bug in manipulating the index of ring cache. +And it should be as below: + virt_dev->num_rings_cached--; + virt_dev->eps[ep_index].new_ring = + virt_dev->ring_cache[virt_dev->num_rings_cached]; + virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL; + +Signed-off-by: Aman Deep +Signed-off-by: Mathias Nyman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-mem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci-mem.c ++++ b/drivers/usb/host/xhci-mem.c +@@ -1331,10 +1331,10 @@ int xhci_endpoint_init(struct xhci_hcd * + /* Attempt to use the ring cache */ + if (virt_dev->num_rings_cached == 0) + return -ENOMEM; ++ virt_dev->num_rings_cached--; + virt_dev->eps[ep_index].new_ring = + virt_dev->ring_cache[virt_dev->num_rings_cached]; + virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL; +- virt_dev->num_rings_cached--; + xhci_reinit_cached_ring(xhci, virt_dev->eps[ep_index].new_ring, + 1, type); + } -- 2.47.3