[PATCH] media: coda: destroy vdoa context on coda_open() error paths

Haoxiang Li posted 1 patch 1 week, 5 days ago
drivers/media/platform/chips-media/coda/coda-common.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] media: coda: destroy vdoa context on coda_open() error paths
Posted by Haoxiang Li 1 week, 5 days ago
vdoa context is not released in the error path. Call
vdoa_context_destroy() to do the cleanup.

Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
---
 drivers/media/platform/chips-media/coda/coda-common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c
index 33f712ff8556..bdc597781e6c 100644
--- a/drivers/media/platform/chips-media/coda/coda-common.c
+++ b/drivers/media/platform/chips-media/coda/coda-common.c
@@ -2721,6 +2721,8 @@ static int coda_open(struct file *file)
 err_clk_enable:
 	pm_runtime_put_sync(dev->dev);
 err_pm_get:
+	if (ctx->vdoa)
+		vdoa_context_destroy(ctx->vdoa);
 	v4l2_fh_del(&ctx->fh, file);
 	v4l2_fh_exit(&ctx->fh);
 err_coda_name_init:
-- 
2.25.1