RE: [PATCH net v3] driver: veth: Fix one possbile memleak when fail to register_netdevice
From: Gao Feng <hidden>
Date: 2017-05-02 10:56:53
From: Gao Feng <hidden>
Date: 2017-05-02 10:56:53
From: David Ahern [mailto:dsa@cumulusnetworks.com] Sent: Monday, May 1, 2017 11:08 PM On 4/28/17 9:51 PM, gfree.wind@foxmail.com wrote:quoted
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index8c39d6d..418376a 100644--- a/drivers/net/veth.c +++ b/drivers/net/veth.c@@ -224,9 +224,21 @@ static int veth_dev_init(struct net_device *dev) return 0; } -static void veth_dev_free(struct net_device *dev) +static void veth_destructor_free(struct net_device *dev)_destructor in the name is confusing since veth_dev_free is the dev->destructor. Perhaps that should be veth_free_stats.
Because I want to emphasize it should be invoked in the destructor. What's your opinion ? [...]
Functionally, it looks good to me. Acked-by: David Ahern <redacted>
Thanks David. I have sent the v4 patches with a series according to David's advice. BTW, because I send multiple patches too fast today, the email server blocks my account. So I have to reply you with a different email account. Sorry. Regards Feng