Linux wireless drivers development
 help / color / mirror / Atom feed
From: Anthony Liu <anthony.liu@mediatek.com>
To: <anthony.liu@mediatek.com>
Cc: <Emery.Hsin@mediatek.com>, <Jb.Tsai@mediatek.com>,
	<Leon.Yen@mediatek.com>, <Litien.Chang@mediatek.com>,
	<Quan.Zhou@mediatek.com>, <Ryder.Lee@mediatek.com>,
	<Sean.Wang@mediatek.com>, <kun.wu@mediatek.com>,
	<linux-wireless@vger.kernel.org>, <lorenzo@kernel.org>,
	<nbd@nbd.name>
Subject: [PATCH v1 1/2] wifi: mt76: init chan pointer to aovid unexpected behavior
Date: Wed, 2 Dec 2026 16:18:05 +0800	[thread overview]
Message-ID: <20261202081806.1297416-1-anthony.liu@mediatek.com> (raw)

In mt76_remain_on_channel(), defensively initialize chandef.chan with
the requested channel instead of using an empty initializer.

Signed-off-by: Anthony Liu <anthony.liu@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/channel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/channel.c b/drivers/net/wireless/mediatek/mt76/channel.c
index b3c17f76b101..0db1e5456c30 100644
--- a/drivers/net/wireless/mediatek/mt76/channel.c
+++ b/drivers/net/wireless/mediatek/mt76/channel.c
@@ -449,7 +449,7 @@ int mt76_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 			   struct ieee80211_channel *chan, int duration,
 			   enum ieee80211_roc_type type)
 {
-	struct cfg80211_chan_def chandef = {};
+	struct cfg80211_chan_def chandef = { .chan = chan };
 	struct mt76_phy *phy = hw->priv;
 	struct mt76_dev *dev = phy->dev;
 	struct mt76_vif_link *mlink;
-- 
2.45.2


             reply	other threads:[~2026-12-02  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  8:18 Anthony Liu [this message]
2026-12-02  8:18 ` [PATCH v1 2/2] wifi: mt76: add boundary check to array accesses Anthony Liu

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=20261202081806.1297416-1-anthony.liu@mediatek.com \
    --to=anthony.liu@mediatek.com \
    --cc=Emery.Hsin@mediatek.com \
    --cc=Jb.Tsai@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Litien.Chang@mediatek.com \
    --cc=Quan.Zhou@mediatek.com \
    --cc=Ryder.Lee@mediatek.com \
    --cc=Sean.Wang@mediatek.com \
    --cc=kun.wu@mediatek.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    /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