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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190530122040.19842-1-michal.kalderon@marvell.com>
Date:   Thu, 30 May 2019 15:20:40 +0300
From:   Michal Kalderon <michal.kalderon@...vell.com>
To:     <michal.kalderon@...vell.com>, <ariel.elior@...vell.com>,
        <davem@...emloft.net>
CC:     <netdev@...r.kernel.org>, <dan.carpenter@...cle.com>
Subject: [PATCH net-next] qed: Fix static checker warning

In some cases abs_ppfid could be printed without being initialized.

Fixes: 79284adeb99e ("qed: Add llh ppfid interface and 100g support for offload protocols")
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Michal Kalderon <michal.kalderon@...vell.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dev.c | 24 +++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index a971418755e9..eec7cb65c7e6 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -1138,12 +1138,12 @@ qed_llh_add_protocol_filter(struct qed_dev *cdev,
 	if (rc)
 		goto err;
 
+	rc = qed_llh_abs_ppfid(cdev, ppfid, &abs_ppfid);
+	if (rc)
+		goto err;
+
 	/* Configure the LLH only in case of a new the filter */
 	if (ref_cnt == 1) {
-		rc = qed_llh_abs_ppfid(cdev, ppfid, &abs_ppfid);
-		if (rc)
-			goto err;
-
 		rc = qed_llh_protocol_filter_to_hilo(cdev, type,
 						     source_port_or_eth_type,
 						     dest_port, &high, &low);
@@ -1195,12 +1195,12 @@ void qed_llh_remove_mac_filter(struct qed_dev *cdev,
 	if (rc)
 		goto err;
 
+	rc = qed_llh_abs_ppfid(cdev, ppfid, &abs_ppfid);
+	if (rc)
+		goto err;
+
 	/* Remove from the LLH in case the filter is not in use */
 	if (!ref_cnt) {
-		rc = qed_llh_abs_ppfid(cdev, ppfid, &abs_ppfid);
-		if (rc)
-			goto err;
-
 		rc = qed_llh_remove_filter(p_hwfn, p_ptt, abs_ppfid,
 					   filter_idx);
 		if (rc)
@@ -1253,12 +1253,12 @@ void qed_llh_remove_protocol_filter(struct qed_dev *cdev,
 	if (rc)
 		goto err;
 
+	rc = qed_llh_abs_ppfid(cdev, ppfid, &abs_ppfid);
+	if (rc)
+		goto err;
+
 	/* Remove from the LLH in case the filter is not in use */
 	if (!ref_cnt) {
-		rc = qed_llh_abs_ppfid(cdev, ppfid, &abs_ppfid);
-		if (rc)
-			goto err;
-
 		rc = qed_llh_remove_filter(p_hwfn, p_ptt, abs_ppfid,
 					   filter_idx);
 		if (rc)
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ