]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qla2xxx: Do not crash system for sp ref count zero
authorHiral Patel <hiral.patel@qlogic.com>
Tue, 4 Aug 2015 17:37:56 +0000 (13:37 -0400)
committerDan Duval <dan.duval@oracle.com>
Thu, 15 Oct 2015 21:45:32 +0000 (17:45 -0400)
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 <hiral.patel@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/scsi/qla2xxx/qla_os.c

index 0ababd517a45ec5a881c707cf95f943360e8e3ee..90bd222486336e46bf015fad640981d69c73a2ed 100644 (file)
@@ -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))