|
@@ -1193,7 +1193,7 @@ static int netvsc_register_vf(struct net_device *vf_netdev)
|
|
|
|
|
|
net_device_ctx = netdev_priv(ndev);
|
|
|
netvsc_dev = net_device_ctx->nvdev;
|
|
|
- if (netvsc_dev == NULL)
|
|
|
+ if (!netvsc_dev || net_device_ctx->vf_netdev)
|
|
|
return NOTIFY_DONE;
|
|
|
|
|
|
netdev_info(ndev, "VF registering: %s\n", vf_netdev->name);
|
|
@@ -1312,7 +1312,7 @@ static int netvsc_unregister_vf(struct net_device *vf_netdev)
|
|
|
|
|
|
net_device_ctx = netdev_priv(ndev);
|
|
|
netvsc_dev = net_device_ctx->nvdev;
|
|
|
- if (netvsc_dev == NULL)
|
|
|
+ if (!netvsc_dev || !net_device_ctx->vf_netdev)
|
|
|
return NOTIFY_DONE;
|
|
|
netdev_info(ndev, "VF unregistering: %s\n", vf_netdev->name);
|
|
|
netvsc_inject_disable(net_device_ctx);
|