Skip to content

Commit f614c33

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 <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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent eab71f6 commit f614c33

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
@@ -2067,8 +2067,10 @@ mt7925_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
20672067
GFP_KERNEL);
20682068
mlink = devm_kzalloc(dev->mt76.dev, sizeof(*mlink),
20692069
GFP_KERNEL);
2070-
if (!mconf || !mlink)
2070+
if (!mconf || !mlink) {
2071+
mt792x_mutex_release(dev);
20712072
return -ENOMEM;
2073+
}
20722074
}
20732075

20742076
mconfs[link_id] = mconf;

0 commit comments

Comments
 (0)