diff options
author | Swapnil Ingle <swapnil.ingle@nutanix.com> | 2021-06-10 16:23:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-10 16:23:51 +0200 |
commit | 3fe0df4843508ffc3517e82e9256c0e2d02932bd (patch) | |
tree | c8b3dfe29d0a2166653a38f8efebd0aa8baf96bb /lib/dma.c | |
parent | 8b6db2e0b3b340dd747c735e48a4691619e063ce (diff) | |
download | libvfio-user-3fe0df4843508ffc3517e82e9256c0e2d02932bd.zip libvfio-user-3fe0df4843508ffc3517e82e9256c0e2d02932bd.tar.gz libvfio-user-3fe0df4843508ffc3517e82e9256c0e2d02932bd.tar.bz2 |
dma: Fix returned sg array (#564)
_dma_addr_sg_split() is supposed to return back sg's if the requested
dma addr spans across regions.
Also adding unit tests to cover these case.
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/dma.c')
-rw-r--r-- | lib/dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -442,7 +442,7 @@ _dma_addr_sg_split(const dma_controller_t *dma, size_t region_len = MIN((uint64_t)(region_end - dma_addr), len); if (cnt < max_sg) { - ret = dma_init_sg(dma, sg, dma_addr, region_len, prot, idx); + ret = dma_init_sg(dma, &sg[cnt], dma_addr, region_len, prot, idx); if (ret < 0) { return ret; } |