diff options
author | John Levon <john.levon@nutanix.com> | 2021-04-06 10:13:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 10:13:39 +0100 |
commit | 49a3bcdf4479e7001db0302c13af880485d0b3a3 (patch) | |
tree | 9dc0fb7911b653246882c21dedbfefeee919e7de /lib/dma.c | |
parent | fe3f7540dbf3b3ba9346fd1deb6298ba163dd28d (diff) | |
download | libvfio-user-49a3bcdf4479e7001db0302c13af880485d0b3a3.zip libvfio-user-49a3bcdf4479e7001db0302c13af880485d0b3a3.tar.gz libvfio-user-49a3bcdf4479e7001db0302c13af880485d0b3a3.tar.bz2 |
dma_controller_remove_regions: reset region array (#413)
Prepare this function for re-usability by clearing the array after removal.
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -199,6 +199,9 @@ dma_controller_remove_regions(dma_controller_t *dma) assert(region->fd == -1); } } + + memset(dma->regions, 0, dma->max_regions * sizeof(dma->regions[0])); + dma->nregions = 0; } void |