virgl: Don't define a local ret variable.

When there is no vulkan support compiled in and user ask for vulkan
support, the current code could fail and clean everything while still
returns success since the outside ret value is not initialized yet.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Lepton Wu 4 years ago
parent 411153c2cb
commit 49ea0562bd
  1. 2
      src/virglrenderer.c

@ -681,7 +681,7 @@ int virgl_renderer_init(void *cookie, int flags, struct virgl_renderer_callbacks
if (flags & VIRGL_RENDERER_THREAD_SYNC)
vkr_flags |= VKR_RENDERER_THREAD_SYNC;
int ret = vkr_renderer_init(vkr_flags);
ret = vkr_renderer_init(vkr_flags);
if (ret)
goto fail;
state.vkr_initialized = true;

Loading…
Cancel
Save