From 3fdc3313ae6b78023e365427d774fc71fa29c531 Mon Sep 17 00:00:00 2001 From: Ashish Mhetre Date: Fri, 10 Mar 2023 17:20:28 +0000 Subject: [PATCH] drm/fusa-capture: Zero out dma_buf_map struct UBSAN is reporting "invalid-load include/linux/dma-buf-map.h". This is because non-boolean value loaded to bool variable is_iomem of dma_buf_map struct. Zeroing out this struct at declaration time make sure that there is no garbage value which will be non-boolean. Bug 3994163 Change-Id: Ia3f0c738fa248d3096d945f08813b7bdbad233f7 Signed-off-by: Ashish Mhetre Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2869258 Tested-by: Bitan Biswas Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: svc_kernel_abi Reviewed-by: Bitan Biswas GVS: Gerrit_Virtual_Submit --- drivers/gpu/drm/tegra/gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index a3a9cd29..3172f51e 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -179,9 +179,9 @@ static void *tegra_bo_mmap(struct host1x_bo *bo) { struct tegra_bo *obj = host1x_to_tegra_bo(bo); #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) - struct iosys_map map; + struct iosys_map map = {0}; #else - struct dma_buf_map map; + struct dma_buf_map map = {0}; #endif int ret;