kernel_samsung_a53x/drivers/usb/dwc3
Thinh Nguyen db9be3536b usb: dwc3: gadget: Fix looping of queued SG entries
commit b7fc65f5141c24785dc8c19249ca4efcf71b3524 upstream.

The dwc3_request->num_queued_sgs is decremented on completion. If a
partially completed request is handled, then the
dwc3_request->num_queued_sgs no longer reflects the total number of
num_queued_sgs (it would be cleared).

Correctly check the number of request SG entries remained to be prepare
and queued. Failure to do this may cause null pointer dereference when
accessing non-existent SG entry.

Cc: stable@vger.kernel.org
Fixes: c96e6725db9d ("usb: dwc3: gadget: Correct the logic for queuing sgs")
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/d07a7c4aa0fcf746cdca0515150dbe5c52000af7.1731545781.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-17 13:24:20 +01:00
..
core-exynos.h
core.c Revert "usb: dwc3: core: Enable GUCTL1 bit 10 for fixing termination error after resume bug" 2024-11-24 00:23:36 +01:00
core.h Revert "usb: dwc3: core: Enable GUCTL1 bit 10 for fixing termination error after resume bug" 2024-11-24 00:23:36 +01:00
debug.h
debugfs.c
drd.c usb: dwc3: Fix default mode initialization 2024-11-18 12:10:58 +01:00
dwc3-exynos-otg.c
dwc3-exynos.c
dwc3-exynos.h
dwc3-haps.c
dwc3-imx8mp.c
dwc3-keystone.c
dwc3-meson-g12a.c
dwc3-of-simple.c
dwc3-omap.c usb: dwc3: omap: add missing depopulate in probe error path 2024-11-23 23:20:55 +01:00
dwc3-pci.c
dwc3-qcom.c USB: dwc3: qcom: fix wakeup after probe deferral 2024-11-18 12:11:08 +01:00
dwc3-st.c usb: dwc3: st: add missing depopulate in probe error path 2024-11-23 23:20:55 +01:00
ep0.c usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart 2024-11-18 12:12:46 +01:00
exynos-otg.h
exynos_usb_tpmon.c
exynos_usb_tpmon.h
gadget.c usb: dwc3: gadget: Fix looping of queued SG entries 2024-12-17 13:24:20 +01:00
gadget.h
host.c
io.h
Kconfig
Makefile
trace.c
trace.h
ulpi.c