wireguard: Omit unnecessary memset of netdev private data
Subsystems (3)
PATCH 1/1 wireguard: Omit unnecessary memset of netdev private data
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 <[email protected]>
--- drivers/net/wireguard/device.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireguard/device.c +0 -1
@@ -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; }
Signature · 1 line
2.43.0
Quoted 5 lines · Tobias Klauser
The memory for
netdev_privis allocated using kvzalloc inalloc_netdev_mqsbeforertnl_link_ops->setupis called so there is no need to zero it again inwg_setup.Signed-off-by Tobias Klauser <[email protected]>
Reviewed-by Simon Horman <[email protected]>
...
Jason A. Donenfeld
maintainerQuoted 5 lines · Tobias Klauser
The memory for
netdev_privis allocated using kvzalloc inalloc_netdev_mqsbeforertnl_link_ops->setupis called so there is no need to zero it again inwg_setup.Signed-off-by Tobias Klauser <[email protected]>
Thanks. Seems reasonable to me. I'll queue it up in the wireguard tree.
Jason