aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-09-22 12:26:55 -0600
committerBrian Paul <[email protected]>2016-09-23 19:54:42 -0600
commit4d0469652484e8300458ae9a7ab46389d9ae04a4 (patch)
treed5a212dae553603081ff64fe88e7b9fb6ccaee67
parent47f16f5e7f2663d922279b6b100b8f4d8c14f330 (diff)
svga: eliminate unneeded gotos in svga_validate_surface_view()
Reviewed-by: Charmaine Lee <[email protected]>
-rw-r--r--src/gallium/drivers/svga/svga_surface.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c
index 7cc7ef1b452..935384150cc 100644
--- a/src/gallium/drivers/svga/svga_surface.c
+++ b/src/gallium/drivers/svga/svga_surface.c
@@ -426,14 +426,12 @@ svga_validate_surface_view(struct svga_context *svga, struct svga_surface *s)
"same resource used in shaderResource and renderTarget 0x%x\n",
s->handle);
s = create_backed_surface_view(svga, s);
- if (!s)
- goto done;
-
+ /* s may be null here if the function failed */
break;
}
}
- if (s->view_id == SVGA3D_INVALID_ID) {
+ if (s && s->view_id == SVGA3D_INVALID_ID) {
SVGA3dResourceType resType;
SVGA3dRenderTargetViewDesc desc;
@@ -478,14 +476,13 @@ svga_validate_surface_view(struct svga_context *svga, struct svga_surface *s)
if (ret != PIPE_OK) {
util_bitmask_clear(svga->surface_view_id_bm, s->view_id);
s->view_id = SVGA3D_INVALID_ID;
- goto done;
+ s = NULL;
}
}
-done:
SVGA_STATS_TIME_POP(svga_sws(svga));
- return &s->base;
+ return s ? &s->base : NULL;
}