aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio
diff options
context:
space:
mode:
authorHaiyang Tan <haiyang.tan.dev@gmail.com>2018-01-20 04:01:28 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2018-01-21 10:30:56 +0000
commit352ecd95c9cef74e1726f750dae86c1f97999275 (patch)
tree5d84d3145c46901388ffe48d90c439475ac36fcf /src/vnet/devices/virtio
parent9b95425de61d9f1c4b8bb7490b1250ac03fd8243 (diff)
vhost_user: 'nregions' saves the actual number of mapped guest physical address area
This patch fixed the VMA leak that if mapping one of guest physical address area get failed. Change-Id: I07b0b9a932209561d6ff2b2dd08a111ea5db2209 Signed-off-by: Haiyang Tan <haiyang.tan.dev@gmail.com>
Diffstat (limited to 'src/vnet/devices/virtio')
-rw-r--r--src/vnet/devices/virtio/vhost-user.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vnet/devices/virtio/vhost-user.c b/src/vnet/devices/virtio/vhost-user.c
index 7470f15b1c3..c7820406538 100644
--- a/src/vnet/devices/virtio/vhost-user.c
+++ b/src/vnet/devices/virtio/vhost-user.c
@@ -852,8 +852,9 @@ vhost_user_socket_read (clib_file_t * uf)
}
vui->region_mmap_addr[i] += vui->regions[i].mmap_offset;
vui->region_mmap_fd[i] = fds[i];
+
+ vui->nregions++;
}
- vui->nregions = msg.memory.nregions;
break;
case VHOST_USER_SET_VRING_NUM: