Hi Xuan, On 10/25/21 22:33, Maxime Coquelin wrote:
This patch fixes possible NULL-pointer dereferencing reported by Coverity and also fixes NUMA reallocation of the async DMA map.Fixes: 7c61fa08b716 ("vhost: enable IOMMU for async vhost") Coverity issue: 373655 Signed-off-by: Maxime Coquelin <[email protected]> --- lib/vhost/vhost_user.c | 45 +++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 25 deletions(-)
I posted this patch to fix the issue reported by Coverity and also other issue on NUMA realloc that I found at the same time. But I wonder whether all this async_map_status is needed. Indeed, if the only place where we DMA map is in vhost_user_mmap_region(). If it fails, the error is propagated, the mem table are freed and NACK is replied to the master. IOW, the device will be in an unusable state. Removing the async DMA map will simplify a lot the code, do you agree to remove it or there is something I missed? Thanks, Maxime

