This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 4dde2234f24 drivers/xhci: fix build error
4dde2234f24 is described below

commit 4dde2234f248b4c055320c720e7362c3cd2ca033
Author: yangsong8 <[email protected]>
AuthorDate: Wed Jan 28 10:15:52 2026 +0800

    drivers/xhci: fix build error
    
    xhci_mem_free() in usbhost_xhci.c passed priv->pg_sb[i], a uint64_t
    physical address, straight to kmm_free(). Where pointers are 32 bits
    the cast fails to build:
    
    error: cast to pointer from integer of different size 
[-Werror=int-to-pointer-cast]
    
    Convert the address back with up_addrenv_pa_to_va() before freeing it.
    
    Signed-off-by: yangsong8 <[email protected]>
---
 drivers/usbhost/usbhost_xhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usbhost/usbhost_xhci.c b/drivers/usbhost/usbhost_xhci.c
index db2e94934f1..b7cafae4051 100644
--- a/drivers/usbhost/usbhost_xhci.c
+++ b/drivers/usbhost/usbhost_xhci.c
@@ -5666,7 +5666,7 @@ static int xhci_mem_free(FAR struct usbhost_xhci_s *priv)
 
   for (i = 0; i < priv->no_scratch; i++)
     {
-      kmm_free((FAR void *)priv->pg_sb[i]);
+      kmm_free((FAR void *)(uintptr_t)up_addrenv_pa_to_va(priv->pg_sb[i]));
     }
 
   kmm_free(priv->pg_sb);

Reply via email to