aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2022-05-12 16:53:05 +0100
committerGitHub <noreply@github.com>2022-05-12 16:53:05 +0100
commitffdd1d68d9a8975f20d73637e4ff39bb64d00efb (patch)
treedea91978d255e8f640fb94a980fa69701c0cdfc2 /lib
parent294aa666fe09a8b6ca133201c7593c54d3cab6e8 (diff)
downloadlibvfio-user-ffdd1d68d9a8975f20d73637e4ff39bb64d00efb.zip
libvfio-user-ffdd1d68d9a8975f20d73637e4ff39bb64d00efb.tar.gz
libvfio-user-ffdd1d68d9a8975f20d73637e4ff39bb64d00efb.tar.bz2
run scan-build in CI (#680)
Yet another static analyzer pass, this one is used by SPDK, and as it did detect some minor issues, it's worth running. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libvfio-user.c2
-rw-r--r--lib/tran_pipe.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c
index 5b95865..fd2465d 100644
--- a/lib/libvfio-user.c
+++ b/lib/libvfio-user.c
@@ -469,7 +469,7 @@ vfu_create_ioeventfd(vfu_ctx_t *vfu_ctx, uint32_t region_idx, int fd,
size_t offset, uint32_t size, uint32_t flags,
uint64_t datamatch)
{
- vfu_reg_info_t *vfu_reg = &vfu_ctx->reg_info[region_idx];
+ vfu_reg_info_t *vfu_reg;
assert(vfu_ctx != NULL);
assert(fd >= 0);
diff --git a/lib/tran_pipe.c b/lib/tran_pipe.c
index 34dd075..dea2c3c 100644
--- a/lib/tran_pipe.c
+++ b/lib/tran_pipe.c
@@ -73,6 +73,10 @@ tran_pipe_send_iovec(int fd, uint16_t msg_id, bool is_reply,
ret = writev(fd, iovecs, nr_iovecs);
+ /* Quieten static analysis. */
+ iovecs[0].iov_base = NULL;
+ iovecs[0].iov_len = 0;
+
if (ret == -1) {
/* Treat a failed write due to EPIPE the same as a short write. */
if (errno == EPIPE) {