public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Ma Ke <make24@iscas.ac.cn>
To: nbd@nbd.name, lorenzo@kernel.org, ryder.lee@mediatek.com,
	shayne.chen@mediatek.com, sean.wang@mediatek.com,
	kvalo@kernel.org, matthias.bgg@gmail.com,
	angelogioacchino.delregno@collabora.com,
	chui-hao.chiu@mediatek.com, howard-yh.hsu@mediatek.com,
	StanleyYP.Wang@mediatek.com, benjamin-jw.lin@mediatek.com,
	allen.ye@mediatek.com, chank.chen@mediatek.com,
	meichia.chiu@mediatek.com, Bo.Jiao@mediatek.com,
	evelyn.tsai@mediatek.com, Money.Wang@mediatek.com,
	akpm@linux-foundation.org
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, Ma Ke <make24@iscas.ac.cn>,
	stable@vger.kernel.org
Subject: [PATCH RESEND] wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he
Date: Mon, 19 Aug 2024 16:54:49 +0800	[thread overview]
Message-ID: <20240819085449.1013279-1-make24@iscas.ac.cn> (raw)

Fix the NULL pointer dereference in mt7996_mcu_sta_bfer_he
routine adding an sta interface to the mt7996 driver.

Found by code review.

Cc: stable@vger.kernel.org
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 2e4fa9f48dfb..cba28d8d5562 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -1544,6 +1544,9 @@ mt7996_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
 	u8 nss_mcs = mt7996_mcu_get_sta_nss(mcs_map);
 	u8 snd_dim, sts;
 
+	if (!vc)
+		return;
+
 	bf->tx_mode = MT_PHY_TYPE_HE_SU;
 
 	mt7996_mcu_sta_sounding_rate(bf);
-- 
2.25.1



             reply	other threads:[~2024-08-19  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19  8:54 Ma Ke [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-08-26  5:18 [PATCH RESEND] wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he Ma Ke
2024-09-03  1:39 Ma Ke
2024-09-03  4:55 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240819085449.1013279-1-make24@iscas.ac.cn \
    --to=make24@iscas.ac.cn \
    --cc=Bo.Jiao@mediatek.com \
    --cc=Money.Wang@mediatek.com \
    --cc=StanleyYP.Wang@mediatek.com \
    --cc=akpm@linux-foundation.org \
    --cc=allen.ye@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=benjamin-jw.lin@mediatek.com \
    --cc=chank.chen@mediatek.com \
    --cc=chui-hao.chiu@mediatek.com \
    --cc=evelyn.tsai@mediatek.com \
    --cc=howard-yh.hsu@mediatek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=meichia.chiu@mediatek.com \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox