summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-09-06 15:10:06 +0200
committerNicolai Hähnle <[email protected]>2016-09-12 13:54:53 +0200
commit9fb8d354cafd080e1616f5bd5e2f50b43c0d820f (patch)
treebc658c423acd4c4c73f5e7cf929873afbecb7c5b /src/gallium/winsys
parenta6c38d47d422f66e4ba17f15144f68c574080b17 (diff)
winsys/amdgpu: clean up error paths in amdgpu_winsys_create
No need to call pb_cache_deinit, because the cache hasn't been initialized at that point. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 33aa4929137..521a78a08af 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -527,17 +527,15 @@ amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create)
/* Create a new winsys. */
ws = CALLOC_STRUCT(amdgpu_winsys);
- if (!ws) {
- pipe_mutex_unlock(dev_tab_mutex);
- return NULL;
- }
+ if (!ws)
+ goto fail;
ws->dev = dev;
ws->info.drm_major = drm_major;
ws->info.drm_minor = drm_minor;
if (!do_winsys_init(ws, fd))
- goto fail;
+ goto fail_alloc;
/* Create managers. */
pb_cache_init(&ws->bo_cache, 500000, ws->check_vm ? 1.0f : 2.0f, 0,
@@ -587,9 +585,9 @@ amdgpu_winsys_create(int fd, radeon_screen_create_t screen_create)
return &ws->base;
+fail_alloc:
+ FREE(ws);
fail:
pipe_mutex_unlock(dev_tab_mutex);
- pb_cache_deinit(&ws->bo_cache);
- FREE(ws);
return NULL;
}