From: Pawel Baldysiak Date: Fri, 27 Feb 2015 14:45:50 +0000 (+0100) Subject: IMSM-orom: make sure, that device list is supported X-Git-Tag: mdadm-3.3.3~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f666bcc6528326c3431b013f47803db904ff65c0;p=thirdparty%2Fmdadm.git 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 --- diff --git a/platform-intel.c b/platform-intel.c index 9c89c20b..1e9ddcd2 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;