Skip to content

Commit d9f2fb6

Browse files
harshimogalapalligregkh
authored andcommitted
wifi: mt76: mt7925: fix locking in mt7925_change_vif_links()
[ Upstream commit 9f15701 ] &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 <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Harshit Mogalapalli <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 3e789f8 commit d9f2fb6

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/wireless/mediatek/mt76/mt7925

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,8 +2005,10 @@ mt7925_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
20052005
GFP_KERNEL);
20062006
mlink = devm_kzalloc(dev->mt76.dev, sizeof(*mlink),
20072007
GFP_KERNEL);
2008-
if (!mconf || !mlink)
2008+
if (!mconf || !mlink) {
2009+
mt792x_mutex_release(dev);
20092010
return -ENOMEM;
2011+
}
20102012
}
20112013

20122014
mconfs[link_id] = mconf;

0 commit comments

Comments
 (0)