summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2025-07-20 21:25:20 +0800
committersakumisu <[email protected]>2025-07-20 21:25:20 +0800
commit2783793b17db45168e08f8f362718ee51b5ad345 (patch)
tree8dc9ce97698e3b068579aaac35606c373b2ad9a4
parente499871a5921f4c12ae5ddb2e0b7070c10683122 (diff)
fix(port/dwc2/usb_hc_dwc2): check buf is valid then using dcache clean
Signed-off-by: sakumisu <[email protected]>
-rw-r--r--port/dwc2/usb_hc_dwc2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/port/dwc2/usb_hc_dwc2.c b/port/dwc2/usb_hc_dwc2.c
index 5693d0ca..abe8ac8f 100644
--- a/port/dwc2/usb_hc_dwc2.c
+++ b/port/dwc2/usb_hc_dwc2.c
@@ -318,7 +318,9 @@ static inline void dwc2_chan_transfer(struct usbh_bus *bus, uint8_t ch_num, uint
if (!(ep_addr & 0x80)) {
chan->dir_in = false;
- usb_dcache_clean((uintptr_t)buf, USB_ALIGN_UP(size, CONFIG_USB_ALIGN_SIZE));
+ if (buf) {
+ usb_dcache_clean((uintptr_t)buf, USB_ALIGN_UP(size, CONFIG_USB_ALIGN_SIZE));
+ }
} else {
chan->dir_in = true;
}