mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: scan: Fix 'mlink' dereferenced before IS_ERR_OR_NULL check
Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Fixes: 3ba20af886d1 ("wifi: mt76: scan: set vif offchannel link for scanning/roc") Signed-off-by: Feng Jiang <[email protected]> Link: https://patch.msgid.link/[email protected]
This commit is contained in:
committed by
Felix Fietkau
parent
ca76c1bced
commit
b70a4a6195
@@ -302,11 +302,13 @@ void mt76_put_vif_phy_link(struct mt76_phy *phy, struct ieee80211_vif *vif,
|
||||
struct mt76_vif_link *mlink)
|
||||
{
|
||||
struct mt76_dev *dev = phy->dev;
|
||||
struct mt76_vif_data *mvif = mlink->mvif;
|
||||
struct mt76_vif_data *mvif;
|
||||
|
||||
if (IS_ERR_OR_NULL(mlink) || !mlink->offchannel)
|
||||
return;
|
||||
|
||||
mvif = mlink->mvif;
|
||||
|
||||
rcu_assign_pointer(mvif->offchannel_link, NULL);
|
||||
dev->drv->vif_link_remove(phy, vif, &vif->bss_conf, mlink);
|
||||
kfree(mlink);
|
||||
|
||||
Reference in New Issue
Block a user