mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02: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 <sean.wang@mediatek.com> Link: https://patch.msgid.link/20260306232238.2039675-9-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
8951131c18
commit
292651cafa
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user