]> git.baikalelectronics.ru Git - kernel.git/commit
macvlan: fix failure during registration v3
authorFrancesco Ruggeri <fruggeri@arista.com>
Sat, 23 Apr 2016 22:03:32 +0000 (15:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Apr 2016 19:17:18 +0000 (15:17 -0400)
commit0600f9e38c1395a1ab58bfb83c97606946c16467
treee755097f21c7b18c56e6a30542793e2b0cd9298b
parent93e4046efc6dabe36e6ec1e8e32bf371bdf717f9
macvlan: fix failure during registration v3

If macvlan_common_newlink fails in register_netdevice after macvlan_init
then it decrements port->count twice, first in macvlan_uninit (from
register_netdevice or rollback_registered) and then again in
macvlan_common_newlink.
A similar problem may exist in the ipvlan driver.
This patch consolidates modifications to port->count into macvlan_init
and macvlan_uninit (thanks to Eric Biederman for suggesting this approach).

v3: remove macvtap specific bits.

Signed-off-by: Francesco Ruggeri <fruggeri@arista.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c