]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
usb: dwc3: Fix crash on fastboot exit due to incorrect memory free
authorBalaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Thu, 7 May 2026 15:20:35 +0000 (20:50 +0530)
committerMarek Vasut <marek.vasut+usb@mailbox.org>
Sat, 9 May 2026 00:26:58 +0000 (02:26 +0200)
The dwc3_free_one_event_buffer() function incorrectly called free()
on event buffer structures allocated with devm_kzalloc(). This
caused heap corruption and a synchronous abort when exiting
fastboot mode via "fastboot continue".

Device-managed memory is automatically freed when the device is
removed, so manual deallocation causes the heap allocator to access
corrupted metadata.

Fixes: 884b10e86a05 ("usb: dwc3: core: fix memory leaks in event buffer cleanup")
Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Reviewed-by: Marek Vasut <marek.vasut+usb@mailbox.org>
drivers/usb/dwc3/core.c

index 0dee14c8b592b0f71fe193494e67452d9b6f8790..be198041f08c22e6418a29cf9931bc4861ba7137 100644 (file)
@@ -208,7 +208,6 @@ static void dwc3_free_one_event_buffer(struct dwc3 *dwc,
                struct dwc3_event_buffer *evt)
 {
        dma_free_coherent(evt->buf);
-       free(evt);
 }
 
 /**