]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virSCSIVHostOpenVhostSCSI: Cleanup
authorTim Wiederhake <twiederh@redhat.com>
Mon, 8 Nov 2021 11:03:43 +0000 (12:03 +0100)
committerTim Wiederhake <twiederh@redhat.com>
Mon, 8 Nov 2021 13:32:32 +0000 (14:32 +0100)
Remove unnecessary label, goto, and closing of not-open file descriptor.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virscsivhost.c

index afbfddb0fbccf2bc70c53ddbdd648f0bcb9fec5b..487301ab642d01fe433bd4bfa4dbb952819a2818 100644 (file)
@@ -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;
 }