aboutsummaryrefslogtreecommitdiff
path: root/lib/dma.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-03-24 17:41:11 +0000
committerGitHub <noreply@github.com>2021-03-24 17:41:11 +0000
commit4f4c378978f0e22ec5b803496e2971adca6a3f8f (patch)
tree5f01e1ff807c1b57efe96332cf6be4e0abd285f7 /lib/dma.c
parent0c27dacfd1cf94609a8b07ece157ed83240915e0 (diff)
downloadlibvfio-user-4f4c378978f0e22ec5b803496e2971adca6a3f8f.zip
libvfio-user-4f4c378978f0e22ec5b803496e2971adca6a3f8f.tar.gz
libvfio-user-4f4c378978f0e22ec5b803496e2971adca6a3f8f.tar.bz2
_dma_addr_sg_split(): set errno when not found (#402)
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/dma.c')
-rw-r--r--lib/dma.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/dma.c b/lib/dma.c
index f5b5540..60e1ae4 100644
--- a/lib/dma.c
+++ b/lib/dma.c
@@ -410,7 +410,8 @@ out:
if (!found) {
// There is still a region which was not found.
assert(len > 0);
- cnt = -1;
+ errno = ENOENT;
+ return -1;
} else if (cnt > max_sg) {
cnt = -cnt - 1;
}