diff options
author | John Levon <john.levon@nutanix.com> | 2022-01-17 17:14:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-17 17:14:54 +0000 |
commit | 12725b96ecda6491c4a6819d3a4d99c9b78c50c1 (patch) | |
tree | 610656c179fd85793a2512e1716ec07a4b3cbccb /lib/libvfio-user.c | |
parent | 17769cf1af093dfb4b9bc3347ae39324029989ac (diff) | |
download | libvfio-user-12725b96ecda6491c4a6819d3a4d99c9b78c50c1.zip libvfio-user-12725b96ecda6491c4a6819d3a4d99c9b78c50c1.tar.gz libvfio-user-12725b96ecda6491c4a6819d3a4d99c9b78c50c1.tar.bz2 |
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 <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/libvfio-user.c')
-rw-r--r-- | lib/libvfio-user.c | 11 |
1 files 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 |