virtio: Close fds when abnormal return.
Here should add close(kickfd) and close(callfd) when abnornal return of failed to send VHOST_USER_SET_VRING_ENABLE. Do this as the same with upper abnormal return. Signed-off-by: dongx.yi <dongx.yi@intel.com> Change-Id: Ic61fc3f398f582f64da6b3f6ca7e237a3d411a8f Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479123 Community-CI: SPDK CI Jenkins <sys_sgci@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
2eda83904b
commit
f591667964
@ -483,6 +483,8 @@ virtio_user_setup_queue(struct virtio_dev *vdev, struct virtqueue *vq)
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("failed to send VHOST_USER_SET_VRING_ENABLE: %s\n",
|
||||
spdk_strerror(-rc));
|
||||
close(kickfd);
|
||||
close(callfd);
|
||||
spdk_free(queue_mem);
|
||||
return -rc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user