summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
authorBart Van Assche2019-04-17 23:44:40 +0200
committerMartin K. Petersen2019-04-29 23:24:51 +0200
commitdb4bf822c58cd2b4a6718c982ce48a5292f5cc6a (patch)
treebb9d2577cd354b067966afc3c6428821cea74f1c /drivers/scsi/qla2xxx/qla_os.c
parentscsi: qla2xxx: Use __le64 instead of uint32_t[2] for sending DMA addresses to... (diff)
downloadkernel-qcow2-linux-db4bf822c58cd2b4a6718c982ce48a5292f5cc6a.tar.gz
kernel-qcow2-linux-db4bf822c58cd2b4a6718c982ce48a5292f5cc6a.tar.xz
kernel-qcow2-linux-db4bf822c58cd2b4a6718c982ce48a5292f5cc6a.zip
scsi: qla2xxx: Complain loudly about reference count underflow
A reference count underflow is a severe bug. Hence complain loudly if a reference count underflow happens. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 73ddd02d1a39..e1c82a0a9745 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -716,14 +716,8 @@ qla2x00_sp_compl(void *ptr, int res)
struct scsi_cmnd *cmd = GET_CMD_SP(sp);
struct completion *comp = sp->comp;
- if (atomic_read(&sp->ref_count) == 0) {
- ql_dbg(ql_dbg_io, sp->vha, 0x3015,
- "SP reference-count to ZERO -- sp=%p cmd=%p.\n",
- sp, GET_CMD_SP(sp));
- if (ql2xextended_error_logging & ql_dbg_io)
- WARN_ON(atomic_read(&sp->ref_count) == 0);
+ if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0))
return;
- }
atomic_dec(&sp->ref_count);
@@ -827,14 +821,8 @@ qla2xxx_qpair_sp_compl(void *ptr, int res)
struct scsi_cmnd *cmd = GET_CMD_SP(sp);
struct completion *comp = sp->comp;
- if (atomic_read(&sp->ref_count) == 0) {
- ql_dbg(ql_dbg_io, sp->fcport->vha, 0x3079,
- "SP reference-count to ZERO -- sp=%p cmd=%p.\n",
- sp, GET_CMD_SP(sp));
- if (ql2xextended_error_logging & ql_dbg_io)
- WARN_ON(atomic_read(&sp->ref_count) == 0);
+ if (WARN_ON_ONCE(atomic_read(&sp->ref_count) == 0))
return;
- }
atomic_dec(&sp->ref_count);