wifi: mt76: mt7925: fix NULL deref check in mt7925_change_vif_links

In mt7925_change_vif_links() devm_kzalloc() may return NULL but this
returned value is not checked.

Fixes: 69acd6d910 ("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>
This commit is contained in:
Charles Han
2024-10-25 15:55:54 +08:00
committed by Felix Fietkau
parent 6d18b66830
commit 5cd0bd815c

View File

@@ -1946,6 +1946,8 @@ mt7925_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
GFP_KERNEL); GFP_KERNEL);
mlink = devm_kzalloc(dev->mt76.dev, sizeof(*mlink), mlink = devm_kzalloc(dev->mt76.dev, sizeof(*mlink),
GFP_KERNEL); GFP_KERNEL);
if (!mconf || !mlink)
return -ENOMEM;
} }
mconfs[link_id] = mconf; mconfs[link_id] = mconf;