LinuxTV Patchwork [06/10] venus: hfi: return an error if session_init is already called

login
register
mail settings
Submitter Stanimir Varbanov
Date Jan. 17, 2019, 4:20 p.m.
Message ID <20190117162008.25217-7-stanimir.varbanov@linaro.org>
Download mbox | patch
Permalink /patch/53981/
State New
Headers show

Comments

Stanimir Varbanov - Jan. 17, 2019, 4:20 p.m.
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(+)

Patch

diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c
index eaa82af9ec09..5374655eda39 100644
--- a/drivers/media/platform/qcom/venus/hfi.c
+++ b/drivers/media/platform/qcom/venus/hfi.c
@@ -207,6 +207,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);
 

Privacy Policy