From 9dcfd7030a459b24c3d4befef8027dacb4f3b89f Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Mon, 8 Nov 2021 12:03:43 +0100 Subject: [PATCH] virSCSIVHostOpenVhostSCSI: Cleanup Remove unnecessary label, goto, and closing of not-open file descriptor. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/util/virscsivhost.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/util/virscsivhost.c b/src/util/virscsivhost.c index afbfddb0fb..487301ab64 100644 --- a/src/util/virscsivhost.c +++ b/src/util/virscsivhost.c @@ -90,15 +90,10 @@ virSCSIVHostOpenVhostSCSI(int *vhostfd) if (*vhostfd < 0) { virReportSystemError(errno, _("Failed to open %s"), VHOST_SCSI_DEVICE); - goto error; + return -1; } return 0; - - error: - VIR_FORCE_CLOSE(*vhostfd); - - return -1; }