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

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

index 82a0970ffcc7d0859bc7395477f868b6ebc0ad5f..aae9386880774a8fe609a7bc0bab35b6a7ae064f 100644 (file)
@@ -11,3 +11,4 @@ x86-xen-remove-undefined-behavior-in-setup_features.patch
 mips-remove-repetitive-increase-irq_err_count.patch
 igb-make-dma-faster-when-cpu-is-active-on-the-pcie-l.patch
 iio-adc-vf610-fix-conversion-mode-sysfs-node-name.patch
+usb-chipidea-udc-check-request-status-before-setting-device-address.patch
diff --git a/queue-4.14/usb-chipidea-udc-check-request-status-before-setting-device-address.patch b/queue-4.14/usb-chipidea-udc-check-request-status-before-setting-device-address.patch
new file mode 100644 (file)
index 0000000..b5e5b06
--- /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
+@@ -923,6 +923,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;