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: <1438742526-28530-1-git-send-email-uboot477@gmail.com>
Date:	Tue,  4 Aug 2015 22:42:06 -0400
From:	Nicholas Krause <uboot477@...il.com>
To:	JBottomley@...n.com
Cc:	davem@...emloft.net, hariprasad@...lsio.com, praveenm@...lsio.com,
	thenzl@...hat.com, dan.carpenter@...cle.com,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
	Nicholas Krause <xerofoify@...il.com>
Subject: [PATCH] csiostor:Fix error handling in the function csio_hws_ready

From: Nicholas Krause <xerofoify@...il.com>

This fixes error handling in the function csio_hws_ready for when
this function calls csio_scim_cleanup_io to cleanup outstanding
commands by checking if it cleaned a error code to signal internal
failure and if so tell the user we are unable to clean up the
outstanding io commands by printing this to the console before

Signed-off-by: Nicholas Krause <xerofoify@...il.com>
---
 drivers/scsi/csiostor/csio_hw.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
index 622bdab..49c47d3 100644
--- a/drivers/scsi/csiostor/csio_hw.c
+++ b/drivers/scsi/csiostor/csio_hw.c
@@ -2445,11 +2445,17 @@ csio_hws_ready(struct csio_hw *hw, enum csio_hw_ev evt)
 		csio_set_state(&hw->sm, csio_hws_quiescing);
 		/* cleanup all outstanding cmds */
 		if (evt == CSIO_HWE_HBA_RESET ||
-		    evt == CSIO_HWE_PCIERR_DETECTED)
-			csio_scsim_cleanup_io(csio_hw_to_scsim(hw), false);
-		else
-			csio_scsim_cleanup_io(csio_hw_to_scsim(hw), true);
-
+		    evt == CSIO_HWE_PCIERR_DETECTED) {
+			if (csio_scsim_cleanup_io(csio_hw_to_scsim(hw), false)) {
+				csio_err(hw, "Unable to properly cleanup outstanding commands on this device\n");
+				return;
+			}
+		} else {
+			if (csio_scsim_cleanup_io(csio_hw_to_scsim(hw), true)) {
+				csio_err(hw, "Unable to properly cleanup outstanding commands on this device\n");
+				return;
+			}
+		}
 		csio_hw_intr_disable(hw);
 		csio_hw_mbm_cleanup(hw);
 		csio_evtq_stop(hw);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ