[PATCH v5 17/23] powerpc/pci: Fix crash with enabled movable BARs

Sergey Miroshnichenko s.miroshnichenko at yadro.com
Sat Aug 17 02:50:55 AEST 2019


Add a check for the UNSET resource flag to skip the released BARs

CC: Alexey Kardashevskiy <aik at ozlabs.ru>
Signed-off-by: Sergey Miroshnichenko <s.miroshnichenko at yadro.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index d8080558d020..362eac42f463 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -2986,7 +2986,8 @@ static void pnv_ioda_setup_pe_res(struct pnv_ioda_pe *pe,
 	int index;
 	int64_t rc;
 
-	if (!res || !res->flags || res->start > res->end)
+	if (!res || !res->flags || res->start > res->end ||
+	    (res->flags & IORESOURCE_UNSET))
 		return;
 
 	if (res->flags & IORESOURCE_IO) {
-- 
2.21.0



More information about the Linuxppc-dev mailing list