[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <070a3de4-d502-45f9-913f-5392e0ebee45@davidwei.uk>
Date: Tue, 18 Jun 2024 16:05:13 -0700
From: David Wei <dw@...idwei.uk>
To: edward.cree@....com, linux-net-drivers@....com, davem@...emloft.com,
kuba@...nel.org, edumazet@...gle.com, pabeni@...hat.com
Cc: Edward Cree <ecree.xilinx@...il.com>, netdev@...r.kernel.org,
habetsm.xilinx@...il.com, sudheer.mogilappagari@...el.com,
jdamato@...tly.com, mw@...ihalf.com, linux@...linux.org.uk,
sgoutham@...vell.com, gakula@...vell.com, sbhatta@...vell.com,
hkelam@...vell.com, saeedm@...dia.com, leon@...nel.org,
jacob.e.keller@...el.com, andrew@...n.ch, ahmed.zaki@...el.com
Subject: Re: [PATCH v5 net-next 1/7] net: move ethtool-related netdev state
into its own struct
On 2024-06-18 15:44, edward.cree@....com wrote:
> 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?
> + 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?
Powered by blists - more mailing lists