diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c b/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c index 138fb3b12..6f95b5876 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c @@ -966,6 +966,8 @@ static int nvgpu_nvs_ctrl_fifo_destroy_queue(struct gk20a *g, goto fail; } + nvgpu_nvs_ctrl_fifo_user_unsubscribe_queue(user, queue); + /* For Event Queues, don't erase even if the buffer * is currently not mapped. There might be some observers * who has acquired the dma_bufs but hasn't mapped yet. @@ -982,8 +984,6 @@ static int nvgpu_nvs_ctrl_fifo_destroy_queue(struct gk20a *g, } } - nvgpu_nvs_ctrl_fifo_user_unsubscribe_queue(user, queue); - nvgpu_nvs_ctrl_fifo_unlock_queues(g); return 0;