]> Pileus Git - ~andy/linux/blobdiff - drivers/vhost/net.c
Merge branch 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[~andy/linux] / drivers / vhost / net.c
index 831eb4fd197d4867f607a42b4ed76541159099ba..9a68409580d5b76d8d3972e42a33314dc22f16f8 100644 (file)
@@ -683,7 +683,7 @@ static int vhost_net_open(struct inode *inode, struct file *f)
        struct vhost_net *n = kmalloc(sizeof *n, GFP_KERNEL);
        struct vhost_dev *dev;
        struct vhost_virtqueue **vqs;
-       int r, i;
+       int i;
 
        if (!n)
                return -ENOMEM;
@@ -706,12 +706,7 @@ static int vhost_net_open(struct inode *inode, struct file *f)
                n->vqs[i].vhost_hlen = 0;
                n->vqs[i].sock_hlen = 0;
        }
-       r = vhost_dev_init(dev, vqs, VHOST_NET_VQ_MAX);
-       if (r < 0) {
-               kfree(n);
-               kfree(vqs);
-               return r;
-       }
+       vhost_dev_init(dev, vqs, VHOST_NET_VQ_MAX);
 
        vhost_poll_init(n->poll + VHOST_NET_VQ_TX, handle_tx_net, POLLOUT, dev);
        vhost_poll_init(n->poll + VHOST_NET_VQ_RX, handle_rx_net, POLLIN, dev);