public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc2: host: Fix dereference issue in DDMA completion flow.
@ 2024-04-09 10:06 Minas Harutyunyan
  2024-04-09 10:10 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Minas Harutyunyan @ 2024-04-09 10:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Minas Harutyunyan, linux-usb@vger.kernel.org
  Cc: John Youn, Minas Harutyunyan

Fixed variable dereference issue in DDMA completion flow.

Fixes: b258e4268850 ("usb: dwc2: host: Fix ISOC flow in DDMA mode")
CC: stable@vger.kernel.org
Signed-off-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
---
 drivers/usb/dwc2/hcd_ddma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c
index 79582b102c7e..994a78ad084b 100644
--- a/drivers/usb/dwc2/hcd_ddma.c
+++ b/drivers/usb/dwc2/hcd_ddma.c
@@ -867,13 +867,15 @@ static int dwc2_cmpl_host_isoc_dma_desc(struct dwc2_hsotg *hsotg,
 	struct dwc2_dma_desc *dma_desc;
 	struct dwc2_hcd_iso_packet_desc *frame_desc;
 	u16 frame_desc_idx;
-	struct urb *usb_urb = qtd->urb->priv;
+	struct urb *usb_urb;
 	u16 remain = 0;
 	int rc = 0;
 
 	if (!qtd->urb)
 		return -EINVAL;
 
+	usb_urb = qtd->urb->priv;
+
 	dma_sync_single_for_cpu(hsotg->dev, qh->desc_list_dma + (idx *
 				sizeof(struct dwc2_dma_desc)),
 				sizeof(struct dwc2_dma_desc),

base-commit: d464dac47260a33add5a206fd3289ec1216e8435
-- 
2.41.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-09 11:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-09 10:06 [PATCH] usb: dwc2: host: Fix dereference issue in DDMA completion flow Minas Harutyunyan
2024-04-09 10:10 ` Greg Kroah-Hartman
2024-04-09 11:39   ` Minas Harutyunyan
2024-04-09 11:45     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox