|
@@ -491,7 +491,13 @@ static int macvtap_newlink(struct net *src_net,
|
|
|
/* Don't put anything that may fail after macvlan_common_newlink
|
|
|
* because we can't undo what it does.
|
|
|
*/
|
|
|
- return macvlan_common_newlink(src_net, dev, tb, data);
|
|
|
+ err = macvlan_common_newlink(src_net, dev, tb, data);
|
|
|
+ if (err) {
|
|
|
+ netdev_rx_handler_unregister(dev);
|
|
|
+ return err;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
static void macvtap_dellink(struct net_device *dev,
|