Commit 5a3d4425 authored by Johann Fischer's avatar Johann Fischer Committed by Carles Cufi
Browse files

drivers: usb_dc_sam: free endpoint memory on End of Reset event



Free endpoint memory on End of Reset event (EORST).

Fixes: #24626

Signed-off-by: default avatarJohann Fischer <j.fischer@phytec.de>
parent 29d95ba1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -256,6 +256,12 @@ static void usb_dc_isr(void)
			usb_dc_ep_enable_interrupts(0);
		}

		/* Free all endpoint memory */
		for (int idx = 1; idx < NUM_OF_EP_MAX; idx++) {
			usb_dc_ep_disable(idx);
			USBHS->USBHS_DEVEPTCFG[idx] &= ~USBHS_DEVEPTCFG_ALLOC;
		}

		/* Callback function */
		dev_data.status_cb(USB_DC_RESET, NULL);
	}