bonding: process the err returned by dev_set_allmulti properly in bond_enslave
authorXin Long <lucien.xin@gmail.com>
Sun, 25 Mar 2018 17:16:47 +0000 (01:16 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 31 May 2018 23:30:25 +0000 (00:30 +0100)
commit19277917a0db893344f247d2ed4ac920c874f0d6
tree3502e10e688b63b79729cfc4d7da2ed2aa8216e8
parent1731866a8cdbf8b8c49348083c565ba0f2b6abff
bonding: process the err returned by dev_set_allmulti properly in bond_enslave

commit 9f5a90c107741b864398f4ac0014711a8c1d8474 upstream.

When dev_set_promiscuity(1) succeeds but dev_set_allmulti(1) fails,
dev_set_promiscuity(-1) should be done before going to the err path.
Otherwise, dev->promiscuity will leak.

Fixes: 7e1a1ac1fbaa ("bonding: Check return of dev_set_promiscuity/allmulti")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/bonding/bond_main.c