lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241228114147.2576079-1-mordan@ispras.ru>
Date: Sat, 28 Dec 2024 14:41:47 +0300
From: Vitalii Mordan <mordan@...ras.ru>
To: Jacopo Mondi <jacopo@...ndi.org>
Cc: Vitalii Mordan <mordan@...ras.ru>,
	Sakari Ailus <sakari.ailus@...ux.intel.com>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Hans Verkuil <hans.verkuil@...co.com>,
	linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Fedor Pchelkin <pchelkin@...ras.ru>,
	Alexey Khoroshilov <khoroshilov@...ras.ru>,
	Vadim Mutilin <mutilin@...ras.ru>
Subject: [PATCH] media: ov772x: fix call balance for priv->clk handling routines

If the clock priv->clk was not enabled in ov772x_power_on, it should not
be disabled in any path.

Conversely, if it was enabled in ov772x_power_on, it must be disabled in
all error paths to ensure proper cleanup.

Found by Linux Verification Center (linuxtesting.org) with Klever.

Fixes: 762c28121d7c ("media: i2c: ov772x: Remove soc_camera dependencies")
Signed-off-by: Vitalii Mordan <mordan@...ras.ru>
---
 drivers/media/i2c/ov772x.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c
index 062e1023a411..8a0556e21659 100644
--- a/drivers/media/i2c/ov772x.c
+++ b/drivers/media/i2c/ov772x.c
@@ -1280,10 +1280,10 @@ static int ov772x_video_probe(struct ov772x_priv *priv)
 	/* Check and show product ID and manufacturer ID. */
 	ret = regmap_read(priv->regmap, PID, &pid);
 	if (ret < 0)
-		return ret;
+		goto done;
 	ret = regmap_read(priv->regmap, VER, &ver);
 	if (ret < 0)
-		return ret;
+		goto done;
 
 	switch (VERSION(pid, ver)) {
 	case OV7720:
@@ -1301,10 +1301,10 @@ static int ov772x_video_probe(struct ov772x_priv *priv)
 
 	ret = regmap_read(priv->regmap, MIDH, &midh);
 	if (ret < 0)
-		return ret;
+		goto done;
 	ret = regmap_read(priv->regmap, MIDL, &midl);
 	if (ret < 0)
-		return ret;
+		goto done;
 
 	dev_info(&client->dev,
 		 "%s Product ID %0x:%0x Manufacturer ID %x:%x\n",
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ