Browse Source

bugfix: pci遍历capability list时无法正确访问下一个list的bug

fslongjin 2 years ago
parent
commit
3d5fe966d3
1 changed files with 2 additions and 3 deletions
  1. 2 3
      kernel/driver/pci/pci.c

+ 2 - 3
kernel/driver/pci/pci.c

@@ -525,12 +525,11 @@ int32_t pci_enumerate_capability_list(struct pci_device_structure_header_t *pci_
     while (1)
     {
         tmp = pci_read_config(pci_dev->bus, pci_dev->device, pci_dev->func, cap_offset);
-        kdebug("tmp & 0xff=%#010lx",tmp & 0xff);
         if ((tmp & 0xff) != cap_type)
         {
-            if ((tmp & 0xff00) >> 8)
+            if (((tmp & 0xff00) >> 8))
             {
-                cap_offset = (tmp & 0xff00);
+                cap_offset = (tmp & 0xff00)>>8;
                 continue;
             }
             else