Re: [PATCH v5 net] rtnetlink: Fix memory(net_device) leak when ->newlink fails

2020-07-17 Thread David Miller
From: Weilong Chen Date: Wed, 15 Jul 2020 20:58:10 +0800 > When vlan_newlink call register_vlan_dev fails, it might return error > with dev->reg_state = NETREG_UNREGISTERED. The rtnl_newlink should > free the memory. But currently rtnl_newlink only free the memory which > state is NETREG_UNINITIA

[PATCH v5 net] rtnetlink: Fix memory(net_device) leak when ->newlink fails

2020-07-15 Thread Weilong Chen
When vlan_newlink call register_vlan_dev fails, it might return error with dev->reg_state = NETREG_UNREGISTERED. The rtnl_newlink should free the memory. But currently rtnl_newlink only free the memory which state is NETREG_UNINITIALIZED. BUG: memory leak unreferenced object 0x8881051de000 (si