From: Greg KH <greg@kroah.com>
To: Ma Ke <make24@iscas.ac.cn>
Cc: 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, Money.Wang@mediatek.com,
Bo.Jiao@mediatek.com, akpm@linux-foundation.org,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, stable@vger.kernel.org
Subject: Re: [PATCH RESEND] wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he
Date: Tue, 3 Sep 2024 06:55:55 +0200 [thread overview]
Message-ID: <2024090332-waged-yummy-296b@gregkh> (raw)
In-Reply-To: <20240903013913.4143602-1-make24@iscas.ac.cn>
On Tue, Sep 03, 2024 at 09:39:13AM +0800, Ma Ke wrote:
> 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;
Why is this the only place you are checking the return value of
mt76_connac_get_he_phy_cap()? Either fix them all in this driver or
none as obviously it can not fail :(
thanks,
greg k-h
next prev parent reply other threads:[~2024-09-03 4:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 1:39 [PATCH RESEND] wifi: mt76: mt7996: fix NULL pointer dereference in mt7996_mcu_sta_bfer_he Ma Ke
2024-09-03 4:55 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-08-26 5:18 Ma Ke
2024-08-19 8:54 Ma Ke
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=2024090332-waged-yummy-296b@gregkh \
--to=greg@kroah.com \
--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=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=make24@iscas.ac.cn \
--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