From 9e1aa234485613154cc1ad2b67988fa5df460a18 Mon Sep 17 00:00:00 2001 From: Arcady Goldmints-Orlov Date: Sun, 7 Feb 2021 13:12:23 -0500 Subject: [PATCH] v3dv: initialize render_fd at the top of physical_device_init This fixes an uninitialized variable warning. Reviewed-by: Iago Toral Quiroga Part-of: --- src/broadcom/vulkan/v3dv_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index 194109f6971..3b254b7ea18 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -597,6 +597,7 @@ physical_device_init(struct v3dv_physical_device *device, { VkResult result = VK_SUCCESS; int32_t master_fd = -1; + int32_t render_fd = -1; struct vk_physical_device_dispatch_table dispatch_table; vk_physical_device_dispatch_table_from_entrypoints @@ -610,7 +611,7 @@ physical_device_init(struct v3dv_physical_device *device, assert(drm_render_device); const char *path = drm_render_device->nodes[DRM_NODE_RENDER]; - int32_t render_fd = open(path, O_RDWR | O_CLOEXEC); + render_fd = open(path, O_RDWR | O_CLOEXEC); if (render_fd < 0) { result = VK_ERROR_INCOMPATIBLE_DRIVER; goto fail;