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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <76351e135cf7ec4d609e60461bae4ba6d3c3a445.1743685415.git.abrahamadekunle50@gmail.com>
Date: Thu,  3 Apr 2025 14:26:42 +0100
From: Abraham Samuel Adekunle <abrahamadekunle50@...il.com>
To: outreachy@...ts.linux.dev,
	julia.lawall@...ia.fr
Cc: gregkh@...uxfoundation.org,
	linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	andy@...nel.org,
	hdegoede@...hat.com,
	mchehab@...nel.org,
	sakari.ailus@...ux.intel.com,
	Abraham Samuel Adekunle <abrahamadekunle50@...il.com>
Subject: [PATCH v2 2/3] staging: media: Remove duplicated NULL tests on a value in av7110

When a value has been tested for NULL in an expression, a
second NULL test on the same value in another expression
is unnecessary when the value has not been assigned NULL.

Remove unnecessary duplicate NULL tests on the same value that
has previously been NULL tested.

Found by Coccinelle

Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@...il.com>
---
 drivers/staging/media/av7110/sp8870.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c
index 0c813860f5b2..65842dd559e3 100644
--- a/drivers/staging/media/av7110/sp8870.c
+++ b/drivers/staging/media/av7110/sp8870.c
@@ -508,12 +508,10 @@ static int sp8870_set_frontend(struct dvb_frontend *fe)
 	}
 
 	if (debug) {
-		if (valid) {
-			if (trials > 1) {
-				pr_info("%s(): firmware lockup!!!\n", __func__);
-				pr_info("%s(): recovered after %i trial(s))\n",  __func__, trials - 1);
-				lockups++;
-			}
+		if (trials > 1) {
+			pr_info("%s(): firmware lockup!!!\n", __func__);
+			pr_info("%s(): recovered after %i trial(s))\n",  __func__, trials - 1);
+			lockups++;
 		}
 		switches++;
 		pr_info("%s(): switches = %i lockups = %i\n", __func__, switches, lockups);
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ