From: Vinson Lee Date: Wed, 14 Oct 2020 23:55:12 +0000 (-0700) Subject: v3dv: Initialize time before usage by free_stale_bos. X-Git-Tag: upstream/21.0.0~3599 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d1fb5fffe346dacda896f9feaa7df4695a1d543;p=platform%2Fupstream%2Fmesa.git v3dv: Initialize time before usage by free_stale_bos. Fix defect reported by Coverity Scan. Uninitialized scalar variable (UNINIT) uninit_use_in_call: Using uninitialized value time.tv_sec when calling free_stale_bos. Fixes: f78c99f357ee ("v3dv/bo: add a maximum size for the bo_cache and a envvar to configure it") Signed-off-by: Vinson Lee Reviewed-by: Alejandro PiƱeiro Part-of: --- diff --git a/src/broadcom/vulkan/v3dv_bo.c b/src/broadcom/vulkan/v3dv_bo.c index 4b9bb5b..ed82315 100644 --- a/src/broadcom/vulkan/v3dv_bo.c +++ b/src/broadcom/vulkan/v3dv_bo.c @@ -447,6 +447,7 @@ v3dv_bo_free(struct v3dv_device *device, if (bo->private && bo->size > cache->max_cache_size - cache->cache_size) { + clock_gettime(CLOCK_MONOTONIC, &time); mtx_lock(&cache->lock); free_stale_bos(device, time.tv_sec); mtx_unlock(&cache->lock);