summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7925
diff options
context:
space:
mode:
authorCharles Han <hanchunchao@inspur.com>2024-10-25 15:55:54 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 10:01:19 +0100
commit2f709fe755c16b811ba7339ae4c3ee2c72323d3d (patch)
treeead39ca4ecb5f02dc2b72da7dc974dfa367d8669 /drivers/net/wireless/mediatek/mt76/mt7925
parent8e8f4cf9a394f842b6f833e1f7eab030ec99c458 (diff)
downloadlinux-2f709fe755c16b811ba7339ae4c3ee2c72323d3d.tar.gz
linux-2f709fe755c16b811ba7339ae4c3ee2c72323d3d.tar.bz2
linux-2f709fe755c16b811ba7339ae4c3ee2c72323d3d.zip
wifi: mt76: mt7925: fix NULL deref check in mt7925_change_vif_links
[ Upstream commit 5cd0bd815c8a48862a296df9b30e0ea0da14acd3 ] In mt7925_change_vif_links() devm_kzalloc() may return NULL but this returned value is not checked. Fixes: 69acd6d910b0 ("wifi: mt76: mt7925: add mt7925_change_vif_links") Signed-off-by: Charles Han <hanchunchao@inspur.com> Link: https://patch.msgid.link/20241025075554.181572-1-hanchunchao@inspur.com Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7925')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7925/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 791c8b00e112..a5110f8485e5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -1946,6 +1946,8 @@ mt7925_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
GFP_KERNEL);
mlink = devm_kzalloc(dev->mt76.dev, sizeof(*mlink),
GFP_KERNEL);
+ if (!mconf || !mlink)
+ return -ENOMEM;
}
mconfs[link_id] = mconf;