瀏覽代碼

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

fslongjin 2 年之前
父節點
當前提交
3d5fe966d3
共有 1 個文件被更改,包括 2 次插入3 次删除
  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