mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
util: Fix error path in virSCSIVHostOpenVhostSCSI
We cannot be sure someone initialized the passed *vhostfd and we certainly don't want or need to be calling VIR_FORCE_CLOSE on what probably is -1. So let's just return -1 immediately.
This commit is contained in:
parent
10c73bf18a
commit
9e030093f2
@ -87,7 +87,7 @@ int
|
||||
virSCSIVHostOpenVhostSCSI(int *vhostfd)
|
||||
{
|
||||
if (!virFileExists(VHOST_SCSI_DEVICE))
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
*vhostfd = open(VHOST_SCSI_DEVICE, O_RDWR);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user