Skip to contentSkip to conversation

wimax/i2400m: Remove VLAIS

PATCH In review Matthias Kaehlcke 4 participants 8 messages Oct 9, 2017 – Oct 25, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wimax/i2400m: Remove VLAIS

From: Behan Webster <[email protected]>

Convert Variable Length Array in Struct (VLAIS) to valid C by converting local struct definition to use a flexible array. The structure is only used to define a cast of a buffer so the size of the struct is not used to allocate storage.

---
 drivers/net/wimax/i2400m/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wimax/i2400m/fw.c +1 -1
index c9c711dcd0e6..a89b5685e68b 100644
@@ -652,7 +652,7 @@ static int i2400m_download_chunk(struct i2400m *i2400m, const void *chunk,
 	struct device *dev = i2400m_dev(i2400m);
 	struct {
 		struct i2400m_bootrom_header cmd;
-		u8 cmd_payload[chunk_len];
+		u8 cmd_payload[];
 	} __packed *buf;
 	struct i2400m_bootrom_header ack;
 
Signature · 1 line
2.14.2.920.gcf0c67979c-goog
#1 lore raw

El Mon, Oct 09, 2017 at 12:41:53PM -0700 Matthias Kaehlcke ha dit:

Quoted 20 lines

From: Behan Webster <[email protected]>

Convert Variable Length Array in Struct (VLAIS) to valid C by converting local struct definition to use a flexible array. The structure is only used to define a cast of a buffer so the size of the struct is not used to allocate storage.

---
 drivers/net/wimax/i2400m/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wimax/i2400m/fw.c +0 -0
index c9c711dcd0e6..a89b5685e68b 100644

drivers/net/wimax/i2400m/fw.c static int i2400m_download_chunk(struct i2400m *i2400m, const void *chunk, · line 657

Quoted 7 lines
drivers/net/wimax/i2400m/fw.c +1 -1
@@ -652,7 +652,7 @@ static int i2400m_download_chunk(struct i2400m *i2400m, const void *chunk,
 	struct device *dev = i2400m_dev(i2400m);
 	struct {
 		struct i2400m_bootrom_header cmd;
-		u8 cmd_payload[chunk_len];
+		u8 cmd_payload[];
 	} __packed *buf;
 	struct i2400m_bootrom_header ack;

ping

any comments on this?

#2 lore raw
Quoted 2 lines

ping
any comments on this?

None from me; I don't have access to this HW anymore, so I can't validate if the change would work or not.

#3 lore raw
Quoted 6 lines · Inaky
Quoted 2 lines

ping
any comments on this?

None from me; I don't have access to this HW anymore, so I can't validate
if the change would work or not.

I still have a 5350 around somewhere, I can make sure firmware loads if you like.

Dan

#4 lore raw
Quoted 8 lines · Inaky
Quoted 4 lines
Quoted 1 line

ping any comments on this?

None from me; I don't have access to this HW anymore, so I can't validate if the change would work or not.

I still have a 5350 around somewhere, I can make sure firmware loads if you like.

That'd be swell Dan, thx

#5 lore raw
Quoted 10 lines · Inaky
Quoted 8 lines · Inaky
Quoted 4 lines
Quoted 1 line

ping any comments on this?

None from me; I don't have access to this HW anymore, so I can't validate if the change would work or not.

I still have a 5350 around somewhere, I can make sure firmware loads if
you like.

That'd be swell Dan, thx

Seems to load firmware, read the MAC, and reboot the card. Couldn't get userspace tools working in a 5m try but the kernel module debug traces indicate the card TX/RX-es commands and we can pull out the card state and rfkill status and things like that.

Inaky, is that enough to verify the patch is OK?

Dan

#7 lore raw
In reply to Matthias Kaehlcke
Quoted 9 lines · Matthias Kaehlcke

El Mon, Oct 09, 2017 at 12:41:53PM -0700 Matthias Kaehlcke ha dit:

Quoted 3 lines
+             u8 cmd_payload[];
      } __packed *buf;
      struct i2400m_bootrom_header ack;

ping

any comments on this?

What for? The patch is clearly correct and Davem already merged it in 4.14, right?

Arnd

#6 lore raw
In reply to Dan Williams
Quoted 14 lines · Dan Williams
Quoted 9 lines · Inaky
Quoted 8 lines · Inaky
Quoted 4 lines
Quoted 1 line

ping any comments on this?

None from me; I don't have access to this HW anymore, so I can't validate if the change would work or not.

I still have a 5350 around somewhere, I can make sure firmware loads if
you like.

Quoted 8 lines
Quoted 1 line

That'd be swell Dan, thx

Seems to load firmware, read the MAC, and reboot the card. Couldn't get userspace tools working in a 5m try but the kernel module debug traces indicate the card TX/RX-es commands and we can pull out the card state and rfkill status and things like that.

Inaky, is that enough to verify the patch is OK?

It is, thanks Dan