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

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

index da028914cedb28cb352ef5fe2fc6903611036441..e1d8ddf66cf7793c5ad5f3501c52270623a18c3e 100644 (file)
@@ -20,3 +20,4 @@ virtio_net-fix-xdp_rxq_info-bug-after-suspend-resume.patch
 gpio-winbond-fix-error-code-in-winbond_gpio_get.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-4.19/usb-chipidea-udc-check-request-status-before-setting-device-address.patch b/queue-4.19/usb-chipidea-udc-check-request-status-before-setting-device-address.patch
new file mode 100644 (file)
index 0000000..75ee6b3
--- /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
+@@ -920,6 +920,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;