SMFC driver overrides V4L2 control handlers when a new context is
created but it forgot to release the overridden handlers when the
context is released.
Change-Id: Id241dd029618d3eca7c37da28f8075e5e6a49360
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
return 0;
err:
+ v4l2_ctrl_handler_free(hdlr);
+
dev_err(smfc->dev, "Failed to install %s control (%d)\n",
msg, hdlr->error);
return hdlr->error;
return 0;
err_clk:
- v4l2_fh_del(&ctx->fh);
- v4l2_fh_exit(&ctx->fh);
v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
-err_control:
err_m2m_ctx_init:
+ v4l2_ctrl_handler_free(&ctx->v4l2_ctrlhdlr);
+err_control:
+ v4l2_fh_del(&ctx->fh);
+ v4l2_fh_exit(&ctx->fh);
kfree(ctx);
return ret;
}
{
struct smfc_ctx *ctx = v4l2_fh_to_smfc_ctx(filp->private_data);
- v4l2_fh_del(&ctx->fh);
v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
+ v4l2_ctrl_handler_free(&ctx->v4l2_ctrlhdlr);
+ v4l2_fh_del(&ctx->fh);
+ v4l2_fh_exit(&ctx->fh);
if (!IS_ERR(ctx->smfc->clk_gate)) {
clk_unprepare(ctx->smfc->clk_gate);