diff --git a/drivers/video/tegra/host/nvdla/nvdla.h b/drivers/video/tegra/host/nvdla/nvdla.h index 32e327ae..ff50e6ed 100644 --- a/drivers/video/tegra/host/nvdla/nvdla.h +++ b/drivers/video/tegra/host/nvdla/nvdla.h @@ -394,5 +394,6 @@ int nvdla_free_gcov_region(struct platform_device *pdev, bool update_region); int nvdla_emulator_submit(struct nvhost_queue *queue, struct nvdla_emu_task *task); +void task_free(struct kref *ref); #endif /* End of __NVHOST_NVDLA_H__ */ diff --git a/drivers/video/tegra/host/nvdla/nvdla_ioctl.c b/drivers/video/tegra/host/nvdla/nvdla_ioctl.c index a2e0996e..38e2cc07 100644 --- a/drivers/video/tegra/host/nvdla/nvdla_ioctl.c +++ b/drivers/video/tegra/host/nvdla/nvdla_ioctl.c @@ -816,6 +816,7 @@ static int nvdla_submit(struct nvdla_private *priv, void *arg) err = nvdla_fill_task(queue, buffers, local_tasks + i, task); if (err) { nvdla_dbg_err(pdev, "failed to fill task[%d]", i + 1); + kref_put(&task->ref, task_free); goto fail_to_fill_task; } nvdla_dbg_info(pdev, "local task[%d] filled", i + 1); @@ -847,6 +848,7 @@ static int nvdla_submit(struct nvdla_private *priv, void *arg) goto fail_to_send_postfences; } nvdla_dbg_info(pdev, "postfences of task[%d] sent", i + 1); + kref_put(&task->ref, task_free); } nvdla_dbg_fn(pdev, "Task submitted, done!"); diff --git a/drivers/video/tegra/host/nvdla/nvdla_queue.c b/drivers/video/tegra/host/nvdla/nvdla_queue.c index 71af69b2..a34ce98c 100644 --- a/drivers/video/tegra/host/nvdla/nvdla_queue.c +++ b/drivers/video/tegra/host/nvdla/nvdla_queue.c @@ -87,7 +87,7 @@ void nvdla_put_task_mem(struct nvdla_task *task) task = NULL; } -static void task_free(struct kref *ref) +void task_free(struct kref *ref) { struct nvdla_task *task = container_of(ref, struct nvdla_task, ref); struct platform_device *pdev = task->queue->pool->pdev;