[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20230804122205.193331-1-xiafukun@huawei.com>
Date: Fri, 4 Aug 2023 20:22:05 +0800
From: Xia Fukun <xiafukun@...wei.com>
To: <davem@...emloft.net>, <hariprasad@...lsio.com>,
<rahul.lakkireddy@...lsio.com>
CC: <linux-kernel@...r.kernel.org>, <xiafukun@...wei.com>
Subject: [PATCH] cxgb4: Optimize the call of memset in fill_default_mask()
When using memset to assign values to fs->mask.fip,
the byte length should be sizeof(fs->mask.fip),
which is more reasonable than lip.
Fixes: 578b46b9383c ("cxgb4: add common api support for configuring filters")
Signed-off-by: Xia Fukun <xiafukun@...wei.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
index 786ceae34488..caadb2283328 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
@@ -1097,7 +1097,7 @@ static void fill_default_mask(struct ch_filter_specification *fs)
memset(fs->mask.lip, ~0, sizeof(fs->mask.lip));
if (fip && !fip_mask)
- memset(fs->mask.fip, ~0, sizeof(fs->mask.lip));
+ memset(fs->mask.fip, ~0, sizeof(fs->mask.fip));
if (fs->val.lport && !fs->mask.lport)
fs->mask.lport = ~0;
--
2.17.1
Powered by blists - more mailing lists