mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-11 13:30:31 +01:00
stw: fix uninitialized variable issue
This commit is contained in:
parent
d885c9dad1
commit
10812b0791
1 changed files with 11 additions and 15 deletions
|
|
@ -80,7 +80,7 @@ stw_create_layer_context(
|
|||
struct stw_context *ctx = NULL;
|
||||
GLvisual *visual = NULL;
|
||||
struct pipe_context *pipe = NULL;
|
||||
UINT_PTR hglrc;
|
||||
UINT_PTR hglrc = 0;
|
||||
|
||||
if(!stw_dev)
|
||||
return 0;
|
||||
|
|
@ -140,25 +140,21 @@ stw_create_layer_context(
|
|||
UINT_PTR i;
|
||||
|
||||
for (i = 0; i < STW_CONTEXT_MAX; i++) {
|
||||
if (stw_dev->ctx_array[i].ctx == NULL)
|
||||
if (stw_dev->ctx_array[i].ctx == NULL) {
|
||||
/* success:
|
||||
*/
|
||||
stw_dev->ctx_array[i].ctx = ctx;
|
||||
hglrc = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* No slot available, fail:
|
||||
*/
|
||||
if (i == STW_CONTEXT_MAX)
|
||||
goto done;
|
||||
|
||||
stw_dev->ctx_array[i].ctx = ctx;
|
||||
|
||||
/* success:
|
||||
*/
|
||||
hglrc = i + 1;
|
||||
}
|
||||
done:
|
||||
pipe_mutex_unlock( stw_dev->mutex );
|
||||
|
||||
return hglrc;
|
||||
/* Success?
|
||||
*/
|
||||
if (hglrc != 0)
|
||||
return hglrc;
|
||||
|
||||
fail:
|
||||
if (visual)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue