Browse Source

fix CWE-468 in xhci.c

fslongjin 2 years ago
parent
commit
20bdc183ca
1 changed files with 1 additions and 1 deletions
  1. 1 1
      kernel/driver/usb/xhci/xhci.c

+ 1 - 1
kernel/driver/usb/xhci/xhci.c

@@ -115,7 +115,7 @@ hardware_intr_controller xhci_hc_intr_controller =
 #define xhci_TRB_set_link_cmd(trb_vaddr)                                       \
     do                                                                         \
     {                                                                          \
-        struct xhci_TRB_normal_t *ptr = (struct xhci_TRB_normal_t *)trb_vaddr; \
+        struct xhci_TRB_normal_t *ptr = (struct xhci_TRB_normal_t *)(trb_vaddr); \
         ptr->TRB_type = TRB_TYPE_LINK;                                         \
         ptr->ioc = 0;                                                          \
         ptr->chain = 0;                                                        \