Commit eba48d82 authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Daniel Verkamp
Browse files

rte_virtio: add missing if() brackets



Some error messages were printed
outside of the error-checking
if() condition.

Fixes: bd273d47 ("rte_vhost: replace strerror() with spdk_strerror_r()")

Change-Id: Icf965ae56ffc2e0970572308b38607ac63cdb1f2
Signed-off-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382943


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent 6f95c325
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -239,10 +239,11 @@ virtio_user_notify_queue(struct virtio_dev *vdev, struct virtqueue *vq)
	struct virtio_user_dev *dev = virtio_dev_get_user_dev(vdev);
	char err_str[64];

	if (write(dev->kickfds[vq->vq_queue_index], &buf, sizeof(buf)) < 0)
	if (write(dev->kickfds[vq->vq_queue_index], &buf, sizeof(buf)) < 0) {
		spdk_strerror_r(errno, err_str, sizeof(err_str));
		SPDK_ERRLOG("failed to kick backend: %s.\n", err_str);
	}
}

static void
virtio_user_free(struct virtio_dev *vdev)
+2 −1
Original line number Diff line number Diff line
@@ -437,9 +437,10 @@ vhost_user_setup(struct virtio_user_dev *dev)
	}

	flag = fcntl(fd, F_GETFD);
	if (fcntl(fd, F_SETFD, flag | FD_CLOEXEC) < 0)
	if (fcntl(fd, F_SETFD, flag | FD_CLOEXEC) < 0) {
		spdk_strerror_r(errno, err_str, sizeof(err_str));
		SPDK_ERRLOG("fcntl failed, %s\n", err_str);
	}

	memset(&un, 0, sizeof(un));
	un.sun_family = AF_UNIX;