aboutsummaryrefslogtreecommitdiff
path: root/lib/dma.c
diff options
context:
space:
mode:
authorFelipe Franciosi <felipe@nutanix.com>2020-08-12 14:40:31 +0100
committerGitHub <noreply@github.com>2020-08-12 14:40:31 +0100
commitb9a2e75360e14e59db651d6081894e0cf20e7c2d (patch)
tree4a9e2ffb299a99b1ebfef09f0939d7b8570cf435 /lib/dma.c
parent5cdbe0fcfdd8e83c07ca0f0975916db65837ad7d (diff)
parent373d297ed7369d1b89b41fa0d34281fa87ddfde5 (diff)
downloadlibvfio-user-b9a2e75360e14e59db651d6081894e0cf20e7c2d.zip
libvfio-user-b9a2e75360e14e59db651d6081894e0cf20e7c2d.tar.gz
libvfio-user-b9a2e75360e14e59db651d6081894e0cf20e7c2d.tar.bz2
Merge pull request #22 from franciozzy/cleanup_3
Cleanup 3
Diffstat (limited to 'lib/dma.c')
-rw-r--r--lib/dma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dma.c b/lib/dma.c
index 17e34e8..eb4b9d4 100644
--- a/lib/dma.c
+++ b/lib/dma.c
@@ -137,6 +137,10 @@ dma_controller_remove_regions(lm_ctx_t *ctx, dma_controller_t *dma)
void
dma_controller_destroy(lm_ctx_t *lm_ctx, dma_controller_t *dma)
{
+ if (dma == NULL) {
+ return;
+ }
+
dma_controller_remove_regions(lm_ctx, dma);
free(dma);
}