diff options
author | Marek Olšák <[email protected]> | 2018-11-19 18:17:40 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-11-23 17:08:44 -0500 |
commit | d4e7d8b7f053db081a4ffdb59dc53f3531b0e60b (patch) | |
tree | 0d6863f84c3f07fa71885b6837b4a0188fc94c78 /src/gallium/winsys/amdgpu | |
parent | 82aa07f81fcc5ed696eea16f48cec7e39c3cd3d1 (diff) |
winsys/amdgpu: fix a device handle leak in amdgpu_winsys_create
Cc: 18.2 18.3 <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium/winsys/amdgpu')
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c index f32bbd9d086..b20d702670d 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c @@ -280,6 +280,12 @@ amdgpu_winsys_create(int fd, const struct pipe_screen_config *config, if (ws) { pipe_reference(NULL, &ws->reference); simple_mtx_unlock(&dev_tab_mutex); + + /* Release the device handle, because we don't need it anymore. + * This function is returning an existing winsys instance, which + * has its own device handle. + */ + amdgpu_device_deinitialize(dev); return &ws->base; } |