Skip to content

Commit d935156

Browse files
Eric Dumazetdavem330
Eric Dumazet
authored andcommitted
macvlan: fix panic if lowerdev in a bond
commit a35e2c1 (macvlan: use rx_handler_data pointer to store macvlan_port pointer V2) added a bug in macvlan_port_create() Steps to reproduce the bug: # ifenslave bond0 eth0 eth1 # ip link add link eth0 up name eth0#1 type macvlan ->error EBUSY # ip link add link eth0 up name eth0#1 type macvlan ->panic Fix: Dont set IFF_MACVLAN_PORT in error case. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7196cd6 commit d935156

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/macvlan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,8 @@ static int macvlan_port_create(struct net_device *dev)
585585
err = netdev_rx_handler_register(dev, macvlan_handle_frame, port);
586586
if (err)
587587
kfree(port);
588-
589-
dev->priv_flags |= IFF_MACVLAN_PORT;
588+
else
589+
dev->priv_flags |= IFF_MACVLAN_PORT;
590590
return err;
591591
}
592592

0 commit comments

Comments
 (0)