Skip to content

Commit aa60117

Browse files
harshimogalapalliopsiff
authored andcommitted
wifi: mt76: mt7925: fix locking in mt7925_change_vif_links()
mainline inclusion from mainline-v6.17-rc5 category: bugfix &dev->mt76.mutex lock is taken using mt792x_mutex_acquire(dev) but not released in one of the error paths, add the unlock to fix it. Fixes: 5cd0bd8 ("wifi: mt76: mt7925: fix NULL deref check in mt7925_change_vif_links") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202503031055.3ZRqxhAl-lkp@intel.com/ Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Link: https://patch.msgid.link/20250727140416.1153406-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry picked from commit 9f15701) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent f048f24 commit aa60117

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • drivers/net/wireless/mediatek/mt76/mt7925

drivers/net/wireless/mediatek/mt76/mt7925/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1982,8 +1982,10 @@ mt7925_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
19821982
GFP_KERNEL);
19831983
mlink = devm_kzalloc(dev->mt76.dev, sizeof(*mlink),
19841984
GFP_KERNEL);
1985-
if (!mconf || !mlink)
1985+
if (!mconf || !mlink) {
1986+
mt792x_mutex_release(dev);
19861987
return -ENOMEM;
1988+
}
19871989
}
19881990

19891991
mconfs[link_id] = mconf;

0 commit comments

Comments
 (0)