aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark2017-03-23 13:58:38 -0500
committerRob Clark2017-03-23 14:22:30 -0500
commita07ae97c75ca45c08327b53df5d8d53e56a46a8a (patch)
tree492a0616da71540779d1470d1404927c339595d2
parentd0dae26ca4e743933f50c1bf4a742e0db8e1994b (diff)
downloadexternal-libdrm-a07ae97c75ca45c08327b53df5d8d53e56a46a8a.tar.gz
external-libdrm-a07ae97c75ca45c08327b53df5d8d53e56a46a8a.tar.xz
external-libdrm-a07ae97c75ca45c08327b53df5d8d53e56a46a8a.zip
freedreno: fix device close issues
Move closing the fd to after subclass ->destroy() (since it might want to delete gem bo's, etc), and actually free() the fd_device object. Signed-off-by: Rob Clark <robclark@freedesktop.org>
-rw-r--r--freedreno/freedreno_device.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/freedreno/freedreno_device.c b/freedreno/freedreno_device.c
index fcbf1402..dba7ec47 100644
--- a/freedreno/freedreno_device.c
+++ b/freedreno/freedreno_device.c
@@ -115,9 +115,10 @@ static void fd_device_del_impl(struct fd_device *dev)
115 fd_bo_cache_cleanup(&dev->bo_cache, 0); 115 fd_bo_cache_cleanup(&dev->bo_cache, 0);
116 drmHashDestroy(dev->handle_table); 116 drmHashDestroy(dev->handle_table);
117 drmHashDestroy(dev->name_table); 117 drmHashDestroy(dev->name_table);
118 dev->funcs->destroy(dev);
118 if (dev->closefd) 119 if (dev->closefd)
119 close(dev->fd); 120 close(dev->fd);
120 dev->funcs->destroy(dev); 121 free(dev);
121} 122}
122 123
123drm_private void fd_device_del_locked(struct fd_device *dev) 124drm_private void fd_device_del_locked(struct fd_device *dev)