mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7925: validate mlink in sta_hdr_trans_tlv()
Replace the dead wcid NULL check in mt7925_mcu_sta_hdr_trans_tlv() with a WARN_ON_ONCE() guard on mlink before dereferencing mlink->wcid. wcid is always derived from mlink, so mlink is the only meaningful object to validate here. Signed-off-by: Sean Wang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+3
-3
@@ -1082,11 +1082,11 @@ mt7925_mcu_sta_hdr_trans_tlv(struct sk_buff *skb,
|
||||
else
|
||||
hdr_trans->from_ds = true;
|
||||
|
||||
wcid = &mlink->wcid;
|
||||
|
||||
if (!wcid)
|
||||
if (WARN_ON_ONCE(!mlink))
|
||||
return;
|
||||
|
||||
wcid = &mlink->wcid;
|
||||
|
||||
hdr_trans->dis_rx_hdr_tran = !test_bit(MT_WCID_FLAG_HDR_TRANS, &wcid->flags);
|
||||
if (test_bit(MT_WCID_FLAG_4ADDR, &wcid->flags)) {
|
||||
hdr_trans->to_ds = true;
|
||||
|
||||
Reference in New Issue
Block a user