From 0500ec214c58dad210ac63694e3f685d4b28a801 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Tue, 13 Jul 2021 17:12:57 +0200 Subject: [PATCH] drivers: usb_dc_mcux_ehci: use K_NO_WAIT in k_heap_alloc() This is called in ISR context and timeout must be set to K_NO_WAIT. Reported-by: Pieter De Gendt Signed-off-by: Johann Fischer --- drivers/usb/device/usb_dc_mcux_ehci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/device/usb_dc_mcux_ehci.c b/drivers/usb/device/usb_dc_mcux_ehci.c index 525898908b4..f5d1928349d 100644 --- a/drivers/usb/device/usb_dc_mcux_ehci.c +++ b/drivers/usb/device/usb_dc_mcux_ehci.c @@ -211,9 +211,9 @@ int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data *const cfg) block->data = NULL; } - block->data = k_heap_alloc(&ep_buf_pool, cfg->ep_mps, K_MSEC(10)); + block->data = k_heap_alloc(&ep_buf_pool, cfg->ep_mps, K_NO_WAIT); if (block->data == NULL) { - LOG_ERR("Memory allocation time-out"); + LOG_ERR("Failed to allocate memory"); return -ENOMEM; }