driver: macvlan: Destroy new macvlan port if macvlan_common_newlink failed.
authorGao Feng <fgao@ikuai8.com>
Fri, 4 Nov 2016 02:28:49 +0000 (10:28 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Nov 2016 18:14:47 +0000 (13:14 -0500)
commitaa5fd0fb77486b8a6764ead8627baa14790e4280
tree6e70de9e52fc25034e88dd6836a418e795b23ec1
parentfd0285a39b1cb496f60210a9a00ad33a815603e7
driver: macvlan: Destroy new macvlan port if macvlan_common_newlink failed.

When there is no existing macvlan port in lowdev, one new macvlan port
would be created. But it doesn't be destoried when something failed later.
It casues some memleak.

Now add one flag to indicate if new macvlan port is created.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c