freedreno: fix double-free on exit
Fixes: a07ae97
("freedreno: fix device close issues")
Signed-off-by: Rob Clark <robclark@freedesktop.org>
main
parent
f02719c524
commit
f45853802e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue