diff mbox series

[v2,05/11] venus: hfi: return an error if session_init is already called

Message ID 20190628130002.24293-6-stanimir.varbanov@linaro.org
State Accepted
Commit a367b9ab3eb5de3836af1ce2a6cae4d56e7de4bd
Headers show
Series [v2,01/11] venus: venc: amend buffer size for bitstream plane | expand

Commit Message

Stanimir Varbanov June 28, 2019, 12:59 p.m. UTC
This makes hfi_session_init to return an error when it is
already called without a call to hfi_session_deinit.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

---
 drivers/media/platform/qcom/venus/hfi.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.17.1
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c
index 82eb889ab541..3d8b1284d1f3 100644
--- a/drivers/media/platform/qcom/venus/hfi.c
+++ b/drivers/media/platform/qcom/venus/hfi.c
@@ -198,6 +198,9 @@  int hfi_session_init(struct venus_inst *inst, u32 pixfmt)
 	const struct hfi_ops *ops = core->ops;
 	int ret;
 
+	if (inst->state != INST_UNINIT)
+		return -EINVAL;
+
 	inst->hfi_codec = to_codec_type(pixfmt);
 	reinit_completion(&inst->done);