[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20241025075554.181572-1-hanchunchao@inspur.com>
Date: Fri, 25 Oct 2024 15:55:54 +0800
From: Charles Han <hanchunchao@...pur.com>
To: <sean.wang@...iatek.com>, <nbd@....name>, <lorenzo@...nel.org>,
<ryder.lee@...iatek.com>
CC: <shayne.chen@...iatek.com>, <kvalo@...nel.org>, <matthias.bgg@...il.com>,
<angelogioacchino.delregno@...labora.com>, <deren.wu@...iatek.com>,
<mingyen.hsieh@...iatek.com>, <linux-wireless@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.or>,
<linux-mediatek@...ts.infradead.org>, Charles Han <hanchunchao@...pur.com>
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 <hanchunchao@...pur.com>
---
drivers/net/wireless/mediatek/mt76/mt7925/main.c | 2 ++
1 file changed, 2 insertions(+)
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;
--
2.31.1
Powered by blists - more mailing lists