Linux Media Controller development
 help / color / mirror / Atom feed
From: Jurison Murati <eng.juri@gmail.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Daniel Scally <dan.scally@ideasonboard.com>,
	Hans de Goede <hansg@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org
Subject: [PATCH 2/2] media: i2c: ov8865: Drop PM runtime reference if stream start fails
Date: Wed, 10 Jun 2026 01:22:55 +0200	[thread overview]
Message-ID: <20260609232255.13559-2-eng.juri@gmail.com> (raw)
In-Reply-To: <20260609232255.13559-1-eng.juri@gmail.com>

ov8865_s_stream() takes a runtime PM reference when enabling the
stream, but returns without releasing it if ov8865_sw_standby()
fails, leaving the reference unbalanced and the sensor powered
indefinitely.

Signed-off-by: Jurison Murati <eng.juri@gmail.com>
---
--- a/drivers/media/i2c/ov8865.c
+++ b/drivers/media/i2c/ov8865.c
@@ -2647,8 +2647,11 @@
 	ret = ov8865_sw_standby(sensor, !enable);
 	mutex_unlock(&sensor->mutex);
 
-	if (ret)
+	if (ret) {
+		if (enable)
+			pm_runtime_put(sensor->dev);
 		return ret;
+	}
 
 	state->streaming = !!enable;
 
-- 
2.49.0

  reply	other threads:[~2026-06-09 23:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 23:22 [PATCH 1/2] media: i2c: ov8865: Program the mode on stream start if needed Jurison Murati
2026-06-09 23:22 ` Jurison Murati [this message]
2026-06-10  7:52   ` [PATCH 2/2] media: i2c: ov8865: Drop PM runtime reference if stream start fails Dan Scally
2026-06-10 10:22     ` Jurison Murati
2026-06-10  7:59   ` Sakari Ailus
2026-06-10 10:22     ` Jurison Murati
2026-06-10  7:42 ` [PATCH 1/2] media: i2c: ov8865: Program the mode on stream start if needed Sakari Ailus
2026-06-10 10:22   ` Jurison Murati
2026-06-10  7:49 ` Dan Scally
2026-06-10 10:22   ` Jurison Murati
2026-06-10 10:22 ` [PATCH v2 1/2] media: i2c: ov8865: Drop the runtime PM usage count on stream failure Jurison Murati
2026-06-10 10:22   ` [PATCH v2 2/2] media: i2c: ov8865: Program the sensor on stream start Jurison Murati
2026-06-10 12:38   ` [PATCH v2 1/2] media: i2c: ov8865: Drop the runtime PM usage count on stream failure Dan Scally

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=20260609232255.13559-2-eng.juri@gmail.com \
    --to=eng.juri@gmail.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=hansg@kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /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