Patchwork [RFC,v2,19/21] powerpc/pci: Fix crash with enabled movable BARs

login
register
mail settings
Submitter Sergey Miroshnichenko
Date Jan. 11, 2019, 3:37 p.m.
Message ID <20190111153707.10140-20-s.miroshnichenko@yadro.com>
Download mbox | patch
Permalink /patch/697855/
State New
Headers show

Comments

Sergey Miroshnichenko - Jan. 11, 2019, 3:37 p.m.
Check a resource for the UNSET flags.

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

Patch

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 1d6406a051f1..6706dac69ee6 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -3037,7 +3037,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) {