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: <20250114194732.3513862-1-mordan@ispras.ru>
Date: Tue, 14 Jan 2025 22:47:32 +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>,
	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>,
	lvc-patches@...uxtesting.org
Subject: [PATCH] media: ov772x: remove the unnecessary check for priv->clk

Remove the unnecessary check in ov772x_power_on(). The resource was either
successfully created during ov772x_probe() or the probe terminated with an
error. Moreover, clk routines do not fail with NULL pointers.

Signed-off-by: Vitalii Mordan <mordan@...ras.ru>
---
 drivers/media/i2c/ov772x.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c
index 8a0556e21659..c70d5dfc9da9 100644
--- a/drivers/media/i2c/ov772x.c
+++ b/drivers/media/i2c/ov772x.c
@@ -877,11 +877,9 @@ static int ov772x_power_on(struct ov772x_priv *priv)
 	struct i2c_client *client = v4l2_get_subdevdata(&priv->subdev);
 	int ret;
 
-	if (priv->clk) {
-		ret = clk_prepare_enable(priv->clk);
-		if (ret)
-			return ret;
-	}
+	ret = clk_prepare_enable(priv->clk);
+	if (ret)
+		return ret;
 
 	if (priv->pwdn_gpio) {
 		gpiod_set_value(priv->pwdn_gpio, 1);
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ