qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/1] /hw/scsi/vhost-scsi.c: Fix a memory leak


From: ruc_gongyuanjun
Subject: [PATCH 1/1] /hw/scsi/vhost-scsi.c: Fix a memory leak
Date: Wed, 9 Dec 2020 19:59:55 +0800

From: yuanjungong <ruc_gongyuanjun@163.com>

close vhostfd before returning.

Signed-off-by: yuanjungong <ruc_gongyuanjun@163.com>
---
 hw/scsi/vhost-scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 4d70fa0..9d12034 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -232,7 +232,7 @@ static void vhost_scsi_realize(DeviceState *dev, Error 
**errp)
     /* Note: we can also get the minimum tpgt from kernel */
     vsc->target = vs->conf.boot_tpgt;
 
-    return;
+    goto clode_fd;
 
  free_vqs:
     if (!vsc->migratable) {
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]