From 398d01ee119404d9d811f33341dcf474a0794411 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 25 Dec 2013 08:42:05 +0800 Subject: [PATCH] Kernel/pci - Catch non-assigned BARs with an error --- KernelLand/Kernel/drv/pci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/KernelLand/Kernel/drv/pci.c b/KernelLand/Kernel/drv/pci.c index e926f94f..3a4ec865 100644 --- a/KernelLand/Kernel/drv/pci.c +++ b/KernelLand/Kernel/drv/pci.c @@ -544,7 +544,11 @@ Uint64 PCI_GetValidBAR(tPCIDev ID, int BARNum, tPCI_BARType Type) break; } ASSERT(ret != -1); - ASSERT(ret); + if( ret == 0 ) { + Log_Error("PCI", "PCI%i BAR%i correct type, but unallocated (0x%x)", + ID, BARNum, bar_val); + return 0; + } return ret; } -- 2.20.1