From 1533b232e68a7aa368ce3235de5e5369824c7147 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Sun, 6 Feb 2022 07:48:21 +0000 Subject: [PATCH] server: properly set map_info at blob export map_info might fail to be initialized if get_map_info failed. Signed-off-by: Yiwei Zhang Reviewed-by: Chia-I Wu Reviewed-by: Ryan Neph --- server/render_context.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/render_context.c b/server/render_context.c index c506dcd..702f76b 100644 --- a/server/render_context.c +++ b/server/render_context.c @@ -159,7 +159,11 @@ render_context_export_blob(struct render_context *ctx, } uint32_t map_info; - virgl_renderer_resource_get_map_info(res_id, &map_info); + ret = virgl_renderer_resource_get_map_info(res_id, &map_info); + if (ret) { + /* properly set map_info when the resource has no map cache info */ + map_info = VIRGL_RENDERER_MAP_CACHE_NONE; + } uint32_t fd_type; int res_fd;