Thread (21 messages) flat view 21 messages, 4 authors, 2024-06-20

Re: [PATCH v5 net-next 1/7] net: move ethtool-related netdev state into its own struct

From: David Wei <hidden>
Date: 2024-06-18 23:05:17

On 2024-06-18 15:44, edward.cree@amd.com wrote:
quoted hunk ↗ jump to hunk
diff --git a/net/core/dev.c b/net/core/dev.c
index c361a7b69da8..29351bbea803 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -11065,6 +11065,9 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
 	dev->real_num_rx_queues = rxqs;
 	if (netif_alloc_rx_queues(dev))
 		goto free_all;
+	dev->ethtool = kzalloc(sizeof(*dev->ethtool), GFP_KERNEL_ACCOUNT);
Why GFP_KERNEL_ACCOUNT instead of just GFP_KERNEL?
quoted hunk ↗ jump to hunk
+	if (!dev->ethtool)
+		goto free_all;
 
 	strcpy(dev->name, name);
 	dev->name_assign_type = name_assign_type;
@@ -11115,6 +11118,7 @@ void free_netdev(struct net_device *dev)
 		return;
 	}
 
+	kfree(dev->ethtool);
dev->ethtool = NULL?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help