summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2017-03-23 14:58:38 -0400
committerRob Clark <robclark@freedesktop.org>2017-03-23 15:22:30 -0400
commita07ae97c75ca45c08327b53df5d8d53e56a46a8a (patch)
tree492a0616da71540779d1470d1404927c339595d2
parentd0dae26ca4e743933f50c1bf4a742e0db8e1994b (diff)
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)
fd_bo_cache_cleanup(&dev->bo_cache, 0);
drmHashDestroy(dev->handle_table);
drmHashDestroy(dev->name_table);
+ dev->funcs->destroy(dev);
if (dev->closefd)
close(dev->fd);
- dev->funcs->destroy(dev);
+ free(dev);
}
drm_private void fd_device_del_locked(struct fd_device *dev)