@@ -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);