freedreno: fix double-free on exit

Fixes: a07ae97 ("freedreno: fix device close issues")
Signed-off-by: Rob Clark <robclark@freedesktop.org>
main
Rob Clark 2017-04-15 14:43:17 -04:00
parent f02719c524
commit f45853802e
1 changed files with 3 additions and 3 deletions

View File

@ -112,13 +112,13 @@ struct fd_device * fd_device_ref(struct fd_device *dev)
static void fd_device_del_impl(struct fd_device *dev)
{
int close_fd = dev->closefd ? dev->fd : -1;
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);
free(dev);
if (close_fd >= 0)
close(close_fd);
}
drm_private void fd_device_del_locked(struct fd_device *dev)