Skip to contentSkip to conversation

IMSM-orom: make sure, that device list is supported

PATCH Applied Pawel Baldysiak 2 participants 2 messages Feb 27, 2015 – Mar 4, 2015 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 platform-intel.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
platform-intel.c +4 -1
index 37274da..c6a28e8 100644
@@ -227,6 +227,8 @@ struct pciExpDataStructFormat {
 	__u16 vendorID;
 	__u16 deviceID;
 	__u16 devListOffset;
+	__u16 pciDataStructLen;
+	__u8 pciDataStructRev;
 } __attribute__ ((packed));
 
 static struct orom_entry oroms[SYS_DEV_MAX];
@@ -323,7 +325,8 @@ static int scan(const void *start, const void *end, const void *data)
 
 	const struct imsm_orom *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;
 
Applied
#1 lore raw
Quoted 22 lines · On Fri, 27 Feb 2015 15:45:50 +0100 Pawel Baldysiak <[email protected]>…

Devices list in PCI Data Structure is supported only in 3 and above revision. Make sure that this is checked.

---
 platform-intel.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
platform-intel.c +2 -0
index 37274da..c6a28e8 100644
@@ -227,6 +227,8 @@ struct pciExpDataStructFormat {
 	__u16 vendorID;
 	__u16 deviceID;
 	__u16 devListOffset;
+	__u16 pciDataStructLen;
+	__u8 pciDataStructRev;
 } __attribute__ ((packed));
 
 static struct orom_entry oroms[SYS_DEV_MAX];

platform-intel.c static int scan(const void *start, const void *end, const void *data) · line 332

Quoted 9 lines
platform-intel.c +2 -1
@@ -323,7 +325,8 @@ static int scan(const void *start, const void *end, const void *data)
 
 	const struct imsm_orom *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;
 

Applied, thanks.

NeilBrown