From: Hiral Patel Date: Tue, 4 Aug 2015 17:37:56 +0000 (-0400) Subject: qla2xxx: Do not crash system for sp ref count zero X-Git-Tag: v4.1.12-92~259^2~3^2~8 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0db99487de5e2e569671c08cd5fd2ca47fe1901e;p=users%2Fjedix%2Flinux-maple.git qla2xxx: Do not crash system for sp ref count zero Orabug: 21946579 Aovid crashing the system in the scenario where firmware just completes the command and it can not find the command during abort mailbox processing. This scenario can lead to sp reference counter being zero. Instead of crashing the system, use WARN_ON to print warning in log file. Signed-off-by: Hiral Patel Signed-off-by: Himanshu Madhani Signed-off-by: James Bottomley Signed-off-by: Dan Duval --- diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 0ababd517a45e..90bd222486336 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -656,7 +656,7 @@ qla2x00_sp_compl(void *data, void *ptr, int res) "SP reference-count to ZERO -- sp=%p cmd=%p.\n", sp, GET_CMD_SP(sp)); if (ql2xextended_error_logging & ql_dbg_io) - BUG(); + WARN_ON(atomic_read(&sp->ref_count) == 0); return; } if (!atomic_dec_and_test(&sp->ref_count))