From: Jinjie Ruan <ruanjinjie@huawei.com>
To: <cai.huoqing@linux.dev>, <andrew+netdev@lunn.ch>,
<davem@davemloft.net>, <edumazet@kernel.org>, <kuba@kernel.org>,
<pabeni@redhat.com>, <netdev@vger.kernel.org>
Cc: <ruanjinjie@huawei.com>
Subject: [PATCH net v2 2/2] net: hinic: Zero-initialise the VLAN filter request
Date: Tue, 24 Nov 2026 11:09:46 +0800 [thread overview]
Message-ID: <20261124030946.1229396-3-ruanjinjie@huawei.com> (raw)
In-Reply-To: <20261124030946.1229396-1-ruanjinjie@huawei.com>
struct hinic_vlan_filter is filled in only in part: func_idx and enable
are set, while status, version and both reserved arrays keep whatever the
stack held. The whole structure is passed to the device as buf_in, so
those bytes are sent to firmware.
Initialise it to zero. Requesting a VLAN filter change is rare, so the
cost is irrelevant, and it keeps reserved fields from carrying garbage
across the management channel.
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
drivers/net/ethernet/huawei/hinic/hinic_port.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.c b/drivers/net/ethernet/huawei/hinic/hinic_port.c
index ad271d7aa52b..dda545aba1c7 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_port.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_port.c
@@ -452,7 +452,7 @@ int hinic_set_vlan_fliter(struct hinic_dev *nic_dev, u32 en)
struct hinic_hwdev *hwdev = nic_dev->hwdev;
struct hinic_hwif *hwif = hwdev->hwif;
struct pci_dev *pdev = hwif->pdev;
- struct hinic_vlan_filter vlan_filter;
+ struct hinic_vlan_filter vlan_filter = {0};
u16 out_size = sizeof(vlan_filter);
int err;
--
2.34.1
next prev parent reply other threads:[~2026-11-24 3:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 3:09 [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter Jinjie Ruan
2026-11-24 3:09 ` [PATCH net v2 1/2] " Jinjie Ruan
2026-11-24 3:09 ` Jinjie Ruan [this message]
2026-12-01 14:17 ` [PATCH net v2 2/2] net: hinic: Zero-initialise the VLAN filter request Paolo Abeni
2026-12-01 14:20 ` [PATCH net v2 0/2] net: hinic: Don't fail probe when firmware lacks rx-vlan-filter patchwork-bot+netdevbpf
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=20261124030946.1229396-3-ruanjinjie@huawei.com \
--to=ruanjinjie@huawei.com \
--cc=andrew+netdev@lunn.ch \
--cc=cai.huoqing@linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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