From f666bcc6528326c3431b013f47803db904ff65c0 Mon Sep 17 00:00:00 2001 From: Pawel Baldysiak Date: Fri, 27 Feb 2015 15:45:50 +0100 Subject: IMSM-orom: make sure, that device list is supported Devices list in PCI Data Structure is supported only in 3 and above revision. Make sure that this is checked. Signed-off-by: Pawel Baldysiak Signed-off-by: NeilBrown --- platform-intel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform-intel.c b/platform-intel.c index 9c89c20..1e9ddcd 100644 --- a/platform-intel.c +++ b/platform-intel.c @@ -227,6 +227,8 @@ struct pciExpDataStructFormat { __u16 vendorID; __u16 deviceID; __u16 devListOffset; + __u16 pciDataStructLen; + __u8 pciDataStructRev; } __attribute__ ((packed)); struct orom_entry *orom_entries; @@ -319,7 +321,8 @@ static int scan(const void *start, const void *end, const void *data) struct orom_entry *orom = add_orom(imsm_mem); - if (ptr->devListOffset) { + /* only PciDataStructure with revision 3 and above supports devices list. */ + if (ptr->pciDataStructRev >= 3 && ptr->devListOffset) { const __u16 *dev_list = (void *)ptr + ptr->devListOffset; int i; -- cgit v1.2.1