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]
Date:   Tue, 6 Oct 2020 22:29:03 +0200
From:   Leonid Kushnir <leonf008@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     mchehab@...nel.org, sakari.ailus@...ux.intel.com,
        gregkh@...uxfoundation.org, leonf008@...il.com,
        linux-media@...r.kernel.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] media: staging: atomisp: Corrected error handling in
 function

This patch fixes check of a result of 'power_up()' function call in
function 'gc0310_s_power()' to do "error handling" instead of "success
handling" as Dan Carpenter noted in his comment on the previous patch.
Lines 'return gc0310_init(sd)' and 'return ret' are swapped, and direct
value of 'ret' is checked in IF statement now.

Signed-off-by: Leonid Kushnir <leonf008@...il.com>
---
 drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
index 8201c15b5769..d170d0adfea4 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
@@ -874,11 +874,12 @@ static int gc0310_s_power(struct v4l2_subdev *sd, int on)
 
 	if (on == 0)
 		return power_down(sd);
+
 	ret = power_up(sd);
-	if (!ret)
-		return gc0310_init(sd);
+	if (ret)
+		return ret;
 
-	return ret;
+	return gc0310_init(sd);
 }
 
 /*
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ