Commit 5cd0bd81 authored by Charles Han's avatar Charles Han Committed by Felix Fietkau
Browse files

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: 69acd6d9 ("wifi: mt76: mt7925: add mt7925_change_vif_links")
Signed-off-by: default avatarCharles Han <hanchunchao@inspur.com>
Link: https://patch.msgid.link/20241025075554.181572-1-hanchunchao@inspur.com


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 6d18b668
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;