Kernel/pci - Catch non-assigned BARs with an error
authorJohn Hodge <[email protected]>
Wed, 25 Dec 2013 00:42:05 +0000 (08:42 +0800)
committerJohn Hodge <[email protected]>
Wed, 25 Dec 2013 00:42:05 +0000 (08:42 +0800)
KernelLand/Kernel/drv/pci.c

index e926f94..3a4ec86 100644 (file)
@@ -544,7 +544,11 @@ Uint64 PCI_GetValidBAR(tPCIDev ID, int BARNum, tPCI_BARType Type)
                break;\r
        }\r
        ASSERT(ret != -1);\r
-       ASSERT(ret);\r
+       if( ret == 0 ) {\r
+               Log_Error("PCI", "PCI%i BAR%i correct type, but unallocated (0x%x)",\r
+                       ID, BARNum, bar_val);\r
+               return 0;\r
+       }\r
        return ret;\r
 }\r
 \r

UCC git Repository :: git.ucc.asn.au