]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 08:50:53 +0000 (10:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 08:50:53 +0000 (10:50 +0200)
added patches:
usb-chipidea-udc-check-request-status-before-setting-device-address.patch

queue-5.4/series
queue-5.4/usb-chipidea-udc-check-request-status-before-setting-device-address.patch [new file with mode: 0644]

index 2b4f21c11d2ec3b6d9e6f21ea997fb8683d3b3b1..a3cd19e38e59dc3293055e942083111c93f3d269 100644 (file)
@@ -34,3 +34,4 @@ gpio-winbond-fix-error-code-in-winbond_gpio_get.patch
 s390-cpumf-handle-events-cycles-and-instructions-ide.patch
 iio-adc-vf610-fix-conversion-mode-sysfs-node-name.patch
 xhci-turn-off-port-power-in-shutdown.patch
+usb-chipidea-udc-check-request-status-before-setting-device-address.patch
diff --git a/queue-5.4/usb-chipidea-udc-check-request-status-before-setting-device-address.patch b/queue-5.4/usb-chipidea-udc-check-request-status-before-setting-device-address.patch
new file mode 100644 (file)
index 0000000..b988ebb
--- /dev/null
@@ -0,0 +1,34 @@
+From b24346a240b36cfc4df194d145463874985aa29b Mon Sep 17 00:00:00 2001
+From: Xu Yang <xu.yang_2@nxp.com>
+Date: Thu, 23 Jun 2022 11:02:42 +0800
+Subject: usb: chipidea: udc: check request status before setting device address
+
+From: Xu Yang <xu.yang_2@nxp.com>
+
+commit b24346a240b36cfc4df194d145463874985aa29b upstream.
+
+The complete() function may be called even though request is not
+completed. In this case, it's necessary to check request status so
+as not to set device address wrongly.
+
+Fixes: 10775eb17bee ("usb: chipidea: udc: update gadget states according to ch9")
+cc: <stable@vger.kernel.org>
+Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
+Link: https://lore.kernel.org/r/20220623030242.41796-1-xu.yang_2@nxp.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/chipidea/udc.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/usb/chipidea/udc.c
++++ b/drivers/usb/chipidea/udc.c
+@@ -921,6 +921,9 @@ isr_setup_status_complete(struct usb_ep
+       struct ci_hdrc *ci = req->context;
+       unsigned long flags;
++      if (req->status < 0)
++              return;
++
+       if (ci->setaddr) {
+               hw_usb_set_address(ci, ci->address);
+               ci->setaddr = false;