Linux-Media Archive on
 help / color / Atom feed
From: Dinghao Liu <>
Cc: Stanimir Varbanov <>,
	Andy Gross <>,
	Bjorn Andersson <>,
	Mauro Carvalho Chehab <>,,,
Subject: [PATCH] media: venus: core: Fix runtime PM imbalance in venus_probe
Date: Sun, 24 May 2020 13:29:33 +0800
Message-ID: <> (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. For other error
paths after this call, things are the same.

Signed-off-by: Dinghao Liu <>
 drivers/media/platform/qcom/venus/core.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 194b10b98767..37db3b594dca 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -289,18 +289,24 @@ static int venus_probe(struct platform_device *pdev)
 		goto err_core_deinit;
 	ret = pm_runtime_put_sync(dev);
-	if (ret)
-		goto err_dev_unregister;
+	if (ret) {
+		v4l2_device_unregister(&core->v4l2_dev);
+		hfi_core_deinit(core, false);
+		venus_shutdown(core);
+		pm_runtime_set_suspended(dev);
+		pm_runtime_disable(dev);
+		hfi_destroy(core);
+		return ret;
+	}
 	return 0;
-	v4l2_device_unregister(&core->v4l2_dev);
 	hfi_core_deinit(core, false);
+	pm_runtime_put_noidle(dev);

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Media Archive on

Archives are clonable:
	git clone --mirror linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ \
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone