Thread (6 messages) 6 messages, 2 authors, 2017-04-26

Re: [PATCH net] net: batman-adv: Fix possible memleaks when fail to register_netdevice

From: Sven Eckelmann <hidden>
Date: 2017-04-25 13:53:19
Also in: batman

On Dienstag, 25. April 2017 20:03:20 CEST gfree.wind-H32Fclmsjq1BDgjK7y7TUQ@public.gmane.org wrote:
From: Gao Feng <redacted>

Because the func batadv_softif_init_late allocate some resources and
it would be invoked in register_netdevice. So we need to invoke the
func batadv_softif_free instead of free_netdev to cleanup when fail
to register_netdevice.
I could be wrong, but shouldn't the destructor be replaced with free_netdevice 
and the batadv_softif_free (without the free_netdev) used as ndo_uninit? The 
line you've changed should then be kept as free_netdevice.

At least this seems to be important when using rtnl_newlink() instead of the 
legacy sysfs netdev stuff from batman-adv. rtnl_newlink() would also only call 
free_netdevice and thus also not run batadv_softif_free. This seems to be only 
fixable by calling ndo_uninit.

Kind regards,
	Sven

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help