summaryrefslogtreecommitdiff
path: root/drivers/vhost/test.c
diff options
context:
space:
mode:
authorZhi Yong Wu <wuzhy@linux.vnet.ibm.com>2013-12-07 00:13:03 +0400
committerDavid S. Miller <davem@davemloft.net>2013-12-07 00:22:05 +0400
commit59566b6e8cc8f8a05022e0f01a1b90974003f092 (patch)
treea5b939d0eea7adb6c907d5bbe354eb93b5487cb2 /drivers/vhost/test.c
parent941c22532f40dafa1320adbbc3776e7971bc0764 (diff)
downloadlinux-59566b6e8cc8f8a05022e0f01a1b90974003f092.tar.xz
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.c8
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;