summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Baldysiak <pawel.baldysiak@intel.com>2015-02-27 15:45:50 +0100
committerNeilBrown <neilb@suse.de>2015-03-04 15:59:53 +1100
commitf666bcc6528326c3431b013f47803db904ff65c0 (patch)
treed7117fef5f9768ebe15e6abb839a7c5a71e01647
parent5e1d612824bdb8d8f5ce30c4cebf1a5165824f42 (diff)
downloadmdadm-f666bcc6528326c3431b013f47803db904ff65c0.tar.gz
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 <pawel.baldysiak@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--platform-intel.c5
1 files changed, 4 insertions, 1 deletions
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;