From: Greg Kroah-Hartman Date: Mon, 27 Jun 2022 08:50:30 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v5.4.202~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90ea6e685f8212917a7eb27276a3d56af4f49f8b;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: usb-chipidea-udc-check-request-status-before-setting-device-address.patch --- diff --git a/queue-4.9/series b/queue-4.9/series index 2d8ee338082..405c72d8238 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -9,3 +9,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.9/usb-chipidea-udc-check-request-status-before-setting-device-address.patch b/queue-4.9/usb-chipidea-udc-check-request-status-before-setting-device-address.patch new file mode 100644 index 00000000000..b988ebb5d14 --- /dev/null +++ b/queue-4.9/usb-chipidea-udc-check-request-status-before-setting-device-address.patch @@ -0,0 +1,34 @@ +From b24346a240b36cfc4df194d145463874985aa29b Mon Sep 17 00:00:00 2001 +From: Xu Yang +Date: Thu, 23 Jun 2022 11:02:42 +0800 +Subject: usb: chipidea: udc: check request status before setting device address + +From: Xu Yang + +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: +Signed-off-by: Xu Yang +Link: https://lore.kernel.org/r/20220623030242.41796-1-xu.yang_2@nxp.com +Signed-off-by: Greg Kroah-Hartman +--- + 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;