From: Dinghao Liu <dinghao.liu@zju.edu.cn>
To: dinghao.liu@zju.edu.cn, kjlu@umn.edu
Cc: Stanimir Varbanov <stanimir.varbanov@linaro.org>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] media: venus: vdec: Fix runtime PM imbalance in vdec_open
Date: Fri, 22 May 2020 19:13:57 +0800 [thread overview]
Message-ID: <20200522111357.2613-1-dinghao.liu@zju.edu.cn> (raw)
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: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
drivers/media/platform/qcom/venus/vdec.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 4ed2628585a1..6f2964130728 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1349,7 +1349,7 @@ static int vdec_open(struct file *file)
ret = pm_runtime_get_sync(core->dev_dec);
if (ret < 0)
- goto err_free_inst;
+ goto err_put_sync;
ret = vdec_ctrl_init(inst);
if (ret)
@@ -1394,7 +1394,6 @@ static int vdec_open(struct file *file)
vdec_ctrl_deinit(inst);
err_put_sync:
pm_runtime_put_sync(core->dev_dec);
-err_free_inst:
kfree(inst);
return ret;
}
--
2.17.1
next reply other threads:[~2020-05-22 11:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-22 11:13 Dinghao Liu [this message]
2020-06-23 9:45 ` [PATCH] media: venus: vdec: Fix runtime PM imbalance in vdec_open Stanimir Varbanov
2020-06-24 6:14 ` dinghao.liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200522111357.2613-1-dinghao.liu@zju.edu.cn \
--to=dinghao.liu@zju.edu.cn \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=kjlu@umn.edu \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=stanimir.varbanov@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).