]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
IMSM-orom: make sure, that device list is supported
authorPawel Baldysiak <pawel.baldysiak@intel.com>
Fri, 27 Feb 2015 14:45:50 +0000 (15:45 +0100)
committerNeilBrown <neilb@suse.de>
Wed, 4 Mar 2015 04:59:53 +0000 (15:59 +1100)
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 <pawel.baldysiak@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
platform-intel.c

index 9c89c20b43635ba2b5df0a34ca8509043c7a87ca..1e9ddcd20cae5e7d7f24d5acc5e7bff5b34acf81 100644 (file)
@@ -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;