The screen argument isn't actually used by lp_jit_screen_init() at this
time, but let's move the call so that we pass a valid pointer.
v2: don't leak screen if lp_jit_screen_init() fails.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
return NULL;
#endif
- if (!lp_jit_screen_init(screen))
- return NULL;
-
#ifdef DEBUG
LP_DEBUG = debug_get_flags_option("LP_DEBUG", lp_debug_flags, 0 );
#endif
if (!screen)
return NULL;
+ if (!lp_jit_screen_init(screen)) {
+ FREE(screen);
+ return NULL;
+ }
+
screen->winsys = winsys;
screen->base.destroy = llvmpipe_destroy_screen;