diff options
author | Sagar Ghuge <[email protected]> | 2019-08-07 14:00:14 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-08-20 00:50:55 -0700 |
commit | 57ce422e20f10b87ca3872dcca75604a7cf75211 (patch) | |
tree | c3a301ccd38c8c3b39b350d119cbce61970bd38f /src/gallium/drivers/iris/iris_state.c | |
parent | 02244bc51572f365e5591d41fa7c0437ecb714b7 (diff) |
iris: Free resource if failed to allocate surface state
Signed-off-by: Sagar Ghuge <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris/iris_state.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_state.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index b8c2871698c..98fe87c7f06 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -2035,8 +2035,10 @@ iris_create_surface(struct pipe_context *ctx, void *map = alloc_surface_states(ice->state.surface_uploader, &surf->surface_state, res->aux.possible_usages); - if (!unlikely(map)) + if (!unlikely(map)) { + pipe_resource_reference(&surf->surface_state.res, NULL); return NULL; + } #if GEN_GEN == 8 void *map_read = alloc_surface_states(ice->state.surface_uploader, |