From 12725b96ecda6491c4a6819d3a4d99c9b78c50c1 Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 17 Jan 2022 17:14:54 +0000 Subject: small get_request_header() cleanup (#637) LGTM.com reports "Comparison is always true because ret <= -1.", and it's indeed correct (but harmless). Clean this up. Signed-off-by: John Levon Reviewed-by: Thanos Makatos --- lib/libvfio-user.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c index e4abfad..3f67992 100644 --- a/lib/libvfio-user.c +++ b/lib/libvfio-user.c @@ -1214,22 +1214,15 @@ get_request_header(vfu_ctx_t *vfu_ctx, vfu_msg_t **msgp) *msgp = alloc_msg(&hdr, fds, nr_fds); if (*msgp == NULL) { - ret = -1; - goto out; - } - - return 0; - -out: - if (ret != 0) { int saved_errno = errno; for (i = 0; i < nr_fds; i++) { close(fds[i]); } errno = saved_errno; + return -1; } - return ret; + return 0; } static bool -- cgit v1.1