On Fri, Nov 28, 2014 at 05:26:29PM +0800, arei.gong...@huawei.com wrote: > From: Gonglei <arei.gong...@huawei.com> > > Signed-off-by: Gonglei <arei.gong...@huawei.com>
Peter, could you pick this up for 2.2 please? Reviewed-by: Michael S. Tsirkin <m...@redhat.com> > --- > hw/scsi/vhost-scsi.c | 1 + > hw/virtio/vhost.c | 2 ++ > 2 files changed, 3 insertions(+) > > diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c > index 308b393..dcb2bc5 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; > } > > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c > index 5d7c40a..5a12861 100644 > --- a/hw/virtio/vhost.c > +++ b/hw/virtio/vhost.c > @@ -817,10 +817,12 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque, > int i, r; > > if (vhost_set_backend_type(hdev, backend_type) < 0) { > + close((uintptr_t)opaque); > return -1; > } > > if (hdev->vhost_ops->vhost_backend_init(hdev, opaque) < 0) { > + close((uintptr_t)opaque); > return -errno; > } > > -- > 1.7.12.4 >