diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvs.h b/drivers/gpu/nvgpu/include/nvgpu/nvs.h index 82e88197c..dadab78eb 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvs.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvs.h @@ -41,7 +41,7 @@ /* * Keep it to page size for now. Can be updated later. */ -#define NVS_QUEUE_DEFAULT_SIZE (64 * 1024) +#define NVS_QUEUE_DEFAULT_SIZE (64U * 1024U) struct gk20a; struct nvgpu_nvs_domain_ioctl; diff --git a/drivers/gpu/nvgpu/os/linux/dmabuf_nvs.c b/drivers/gpu/nvgpu/os/linux/dmabuf_nvs.c index 1ec083098..ac7bd18eb 100644 --- a/drivers/gpu/nvgpu/os/linux/dmabuf_nvs.c +++ b/drivers/gpu/nvgpu/os/linux/dmabuf_nvs.c @@ -85,6 +85,7 @@ static int nvs_release_user_mappings_locked(struct gk20a *g, struct nvgpu_nvs_li zap_vma_entries(g, vma); linux_buf->mapped_ref--; + nvgpu_kfree(g, current_entry); } return err; diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c b/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c index 9a04bb580..1c2d20087 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_nvs.c @@ -947,14 +947,14 @@ static int nvgpu_nvs_ctrl_fifo_destroy_queue(struct gk20a *g, } } + nvgpu_nvs_ctrl_fifo_lock_queues(g); + queue = nvgpu_nvs_ctrl_fifo_get_queue(g->sched_ctrl_fifo, num_queue, queue_direction, &mask); if (queue == NULL) { err = -EOPNOTSUPP; goto fail; } - nvgpu_nvs_ctrl_fifo_lock_queues(g); - if (!nvgpu_nvs_ctrl_fifo_user_is_subscribed_to_queue(user, queue)) { err = -EPERM; goto fail;