提交 9e030093 编写于 作者: J John Ferlan

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.
上级 10c73bf1
......@@ -87,7 +87,7 @@ int
virSCSIVHostOpenVhostSCSI(int *vhostfd)
{
if (!virFileExists(VHOST_SCSI_DEVICE))
goto error;
return -1;
*vhostfd = open(VHOST_SCSI_DEVICE, O_RDWR);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册