summaryrefslogtreecommitdiff
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2018-05-31 05:05:07 +0300
committerDavid S. Miller <davem@davemloft.net>2018-06-01 05:50:13 +0300
commit4b8e6ac41a594ea67ded6af6af5935f03221ea4c (patch)
tree3a6680a8a4383765cc0dc24ffcb418ddbf4c4940 /drivers/net/virtio_net.c
parentccf8dbcd062a930e64741c939ca784d15316aa0c (diff)
downloadlinux-4b8e6ac41a594ea67ded6af6af5935f03221ea4c.tar.xz
virtio_net: fix error return code in virtnet_probe()
Fix to return a negative error code from the failover create fail error handling case instead of 0, as done elsewhere in this function. Fixes: ba5e4426e80e ("virtio_net: Extend virtio to use VF datapath when available") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Jason Wang <jasowang@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 8f08a3e1bbaa..2d55e2af7cb6 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2935,8 +2935,10 @@ static int virtnet_probe(struct virtio_device *vdev)
if (virtio_has_feature(vdev, VIRTIO_NET_F_STANDBY)) {
vi->failover = net_failover_create(vi->dev);
- if (IS_ERR(vi->failover))
+ if (IS_ERR(vi->failover)) {
+ err = PTR_ERR(vi->failover);
goto free_vqs;
+ }
}
err = register_netdev(dev);