]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: mt76: mt7925: guard link STA in decap offload
authorGuangshuo Li <lgs201920130244@gmail.com>
Wed, 8 Jul 2026 07:55:39 +0000 (15:55 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 22 Jul 2026 06:09:31 +0000 (06:09 +0000)
commit96ea44f2269f30364cffa054ee3a87e595bef0d4
tree3d0d6fdd90aa1b492fb77b33ae38f42059043800
parent13b7e6a96a005c656d38f3da51581deaf9866375
wifi: mt76: mt7925: guard link STA in decap offload

mt7925_sta_set_decap_offload() iterates over the vif valid_links mask
when updating decap offload state for an MLO station. The station may not
have a link STA for every valid link of the vif, so mt792x_sta_to_link()
can return NULL for a link that belongs to the vif but not to the station.

The function currently dereferences mlink before checking whether the
link WCID is ready. If mlink is NULL, setting or clearing
MT_WCID_FLAG_HDR_TRANS dereferences a NULL pointer.

Skip links without a station link before touching mlink->wcid.

Fixes: b859ad65309a ("wifi: mt76: mt7925: add link handling in mt7925_sta_set_decap_offload")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Link: https://patch.msgid.link/20260708075539.726200-1-lgs201920130244@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/main.c