mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] wifi: p54: fix incorrect frame length check in p54_find_ie()
@ 2026-09-03  8:12 Wang Yan
  0 siblings, 0 replies; only message in thread
From: Wang Yan @ 2026-09-03  8:12 UTC (permalink / raw)
  To: chunkeey
  Cc: johannes.berg, zilin, wangyan01, linville, Larry.Finger,
	linux-wireless, linux-kernel

In p54_find_ie(), mgmt is a pointer to struct ieee80211_mgmt, so
sizeof(mgmt) evaluates to the size of the pointer rather than the size
of the management frame header.

Use sizeof(*mgmt) instead so that the skb length is compared against
the actual size of the management frame header.

Fixes: 0ac0d6cedf61 ("p54: Move mac80211 glue code")
Signed-off-by: Wang Yan <wangyan01@kylinos.cn>
---
 drivers/net/wireless/intersil/p54/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intersil/p54/main.c b/drivers/net/wireless/intersil/p54/main.c
index 57a62108cbc3..d3e1776174f9 100644
--- a/drivers/net/wireless/intersil/p54/main.c
+++ b/drivers/net/wireless/intersil/p54/main.c
@@ -76,7 +76,7 @@ u8 *p54_find_ie(struct sk_buff *skb, u8 ie)
 	struct ieee80211_mgmt *mgmt = (void *)skb->data;
 	u8 *pos, *end;
 
-	if (skb->len <= sizeof(mgmt))
+	if (skb->len <= sizeof(*mgmt))
 		return NULL;
 
 	pos = (u8 *)mgmt->u.beacon.variable;
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-03  8:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03  8:12 [PATCH] wifi: p54: fix incorrect frame length check in p54_find_ie() Wang Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®