Skip to contentSkip to conversation

staging: wilc1000: Fix type of argument in ieee80211_is_action()

PATCH In review Nishad Kamdar 2 participants 3 messages Jun 10, 2018 – Jun 17, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: wilc1000: Fix type of argument in ieee80211_is_action()

Type used is unsigned char but expected is restricted __le16. Warning reported by sparse. Part of eudyptula challenge.

---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -1
index e248702ee519..745bf5ca2622 100644
@@ -1431,7 +1431,7 @@ void wilc_wfi_p2p_rx(struct net_device *dev, u8 *buff, u32 size)
 
 	freq = ieee80211_channel_to_frequency(curr_channel, NL80211_BAND_2GHZ);
 
-	if (!ieee80211_is_action(buff[FRAME_TYPE_ID])) {
+	if (!ieee80211_is_action(cpu_to_le16(buff[FRAME_TYPE_ID]))) {
 		cfg80211_rx_mgmt(priv->wdev, freq, 0, buff, size, 0);
 		return;
 	}
Signature · 1 line
2.17.0
#1 lore raw
Quoted 3 lines · Nishad Kamdar

Type used is unsigned char but expected is restricted __le16. Warning reported by sparse. Part of eudyptula challenge.

The code is buggy, but this fix just papers over it. We discussed this code earlier.

https://lkml.org/lkml/2018/6/5/304

regards,
dan carpenter

#2 lore raw
Quoted 5 lines · Dan Carpenter
Quoted 3 lines · Nishad Kamdar

Type used is unsigned char but expected is restricted __le16. Warning reported by sparse. Part of eudyptula challenge.

Quoted 8 lines

The code is buggy, but this fix just papers over it. We discussed this code earlier.

https://lkml.org/lkml/2018/6/5/304

regards,
dan carpenter

Ok, I will look at the discussion. Thanks for the review.

regards,
nishad kamdar