diff options
author | Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> | 2013-12-07 04:13:03 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-06 15:22:05 -0500 |
commit | 59566b6e8cc8f8a05022e0f01a1b90974003f092 (patch) | |
tree | a5b939d0eea7adb6c907d5bbe354eb93b5487cb2 /drivers/vhost/test.c | |
parent | 941c22532f40dafa1320adbbc3776e7971bc0764 (diff) | |
download | linux-stable-59566b6e8cc8f8a05022e0f01a1b90974003f092.tar.gz linux-stable-59566b6e8cc8f8a05022e0f01a1b90974003f092.tar.bz2 linux-stable-59566b6e8cc8f8a05022e0f01a1b90974003f092.zip |
vhost: remove the dead branch
Since vhost_dev_init() forever return 0, some branches are never run,
therefore need to be removed.
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/vhost/test.c')
-rw-r--r-- | drivers/vhost/test.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index 339eae85859a..c2a54fbf7f99 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -104,7 +104,6 @@ static int vhost_test_open(struct inode *inode, struct file *f) struct vhost_test *n = kmalloc(sizeof *n, GFP_KERNEL); struct vhost_dev *dev; struct vhost_virtqueue **vqs; - int r; if (!n) return -ENOMEM; @@ -117,12 +116,7 @@ static int vhost_test_open(struct inode *inode, struct file *f) dev = &n->dev; vqs[VHOST_TEST_VQ] = &n->vqs[VHOST_TEST_VQ]; n->vqs[VHOST_TEST_VQ].handle_kick = handle_vq_kick; - r = vhost_dev_init(dev, vqs, VHOST_TEST_VQ_MAX); - if (r < 0) { - kfree(vqs); - kfree(n); - return r; - } + vhost_dev_init(dev, vqs, VHOST_TEST_VQ_MAX); f->private_data = n; |