Commit 831b8755 authored by Dinghao Liu's avatar Dinghao Liu Committed by Mauro Carvalho Chehab

media: venus: venc: Fix runtime PM imbalance in venc_open

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent e0eb3481
......@@ -1177,7 +1177,7 @@ static int venc_open(struct file *file)
ret = pm_runtime_get_sync(core->dev_enc);
if (ret < 0)
goto err_free_inst;
goto err_put_sync;
ret = venc_ctrl_init(inst);
if (ret)
......@@ -1222,7 +1222,6 @@ static int venc_open(struct file *file)
venc_ctrl_deinit(inst);
err_put_sync:
pm_runtime_put_sync(core->dev_enc);
err_free_inst:
kfree(inst);
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment