summary refs log tree commit diff stats
path: root/hw/scsi/vhost-scsi.c
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-11-28 17:26:29 +0800
committerPeter Maydell <peter.maydell@linaro.org>2014-12-01 12:29:35 +0000
commitb19ca188022d720e6cdf87c43c27cb68bac32f6a (patch)
treea25ca2275c555f96376039b23487f0c450732b2f /hw/scsi/vhost-scsi.c
parentdb12451decf7dfe0f083564183e135f2095228b9 (diff)
downloadfocaccia-qemu-b19ca188022d720e6cdf87c43c27cb68bac32f6a.tar.gz
focaccia-qemu-b19ca188022d720e6cdf87c43c27cb68bac32f6a.zip
vhost: Fix vhostfd leak in error branch
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1417166789-1960-1-git-send-email-arei.gonglei@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/scsi/vhost-scsi.c')
-rw-r--r--hw/scsi/vhost-scsi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 308b393f96..dcb2bc5a6e 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -233,6 +233,7 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp)
                                vhost_dummy_handle_output);
     if (err != NULL) {
         error_propagate(errp, err);
+        close(vhostfd);
         return;
     }