From b47e20b440ae673ae463cc31aeda26252d8909d5 Mon Sep 17 00:00:00 2001 From: Charles Han Date: Fri, 25 Oct 2024 15:55:54 +0800 Subject: [PATCH] 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: 69acd6d910b0 ("wifi: mt76: mt7925: add mt7925_change_vif_links") Signed-off-by: Charles Han Link: https://patch.msgid.link/20241025075554.181572-1-hanchunchao@inspur.com Signed-off-by: Felix Fietkau --- mt7925/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mt7925/main.c b/mt7925/main.c index e4c1d43a..75a839d2 100644 --- a/mt7925/main.c +++ b/mt7925/main.c @@ -1941,6 +1941,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;