* [PATCH net-next] wireguard: Omit unnecessary memset of netdev private data
@ 2024-09-19 8:57 Tobias Klauser
2024-09-19 12:16 ` Simon Horman
2024-09-20 15:27 ` Jason A. Donenfeld
0 siblings, 2 replies; 3+ messages in thread
From: Tobias Klauser @ 2024-09-19 8:57 UTC (permalink / raw)
To: wireguard, netdev
Cc: Jason A. Donenfeld, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
The memory for netdev_priv is allocated using kvzalloc in
alloc_netdev_mqs before rtnl_link_ops->setup is called so there is no
need to zero it again in wg_setup.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
drivers/net/wireguard/device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c
index 45e9b908dbfb..a2ba71fbbed4 100644
--- a/drivers/net/wireguard/device.c
+++ b/drivers/net/wireguard/device.c
@@ -302,7 +302,6 @@ static void wg_setup(struct net_device *dev)
/* We need to keep the dst around in case of icmp replies. */
netif_keep_dst(dev);
- memset(wg, 0, sizeof(*wg));
wg->dev = dev;
}
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] wireguard: Omit unnecessary memset of netdev private data
2024-09-19 8:57 [PATCH net-next] wireguard: Omit unnecessary memset of netdev private data Tobias Klauser
@ 2024-09-19 12:16 ` Simon Horman
2024-09-20 15:27 ` Jason A. Donenfeld
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-09-19 12:16 UTC (permalink / raw)
To: Tobias Klauser
Cc: wireguard, netdev, Jason A. Donenfeld, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
On Thu, Sep 19, 2024 at 10:57:46AM +0200, Tobias Klauser wrote:
> The memory for netdev_priv is allocated using kvzalloc in
> alloc_netdev_mqs before rtnl_link_ops->setup is called so there is no
> need to zero it again in wg_setup.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Reviewed-by: Simon Horman <horms@kernel.org>
...
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] wireguard: Omit unnecessary memset of netdev private data
2024-09-19 8:57 [PATCH net-next] wireguard: Omit unnecessary memset of netdev private data Tobias Klauser
2024-09-19 12:16 ` Simon Horman
@ 2024-09-20 15:27 ` Jason A. Donenfeld
1 sibling, 0 replies; 3+ messages in thread
From: Jason A. Donenfeld @ 2024-09-20 15:27 UTC (permalink / raw)
To: Tobias Klauser
Cc: wireguard, netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
On Thu, Sep 19, 2024 at 10:57:46AM +0200, Tobias Klauser wrote:
> The memory for netdev_priv is allocated using kvzalloc in
> alloc_netdev_mqs before rtnl_link_ops->setup is called so there is no
> need to zero it again in wg_setup.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Thanks. Seems reasonable to me. I'll queue it up in the wireguard tree.
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-18 1:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-19 8:57 [PATCH net-next] wireguard: Omit unnecessary memset of netdev private data Tobias Klauser
2024-09-19 12:16 ` Simon Horman
2024-09-20 15:27 ` Jason A. Donenfeld
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).