Skip to content

Commit

Permalink
scsi: qla2xxx: Complain if sp->done() is not called from the completi…
Browse files Browse the repository at this point in the history
…on path

Not calling sp->done() from the command completion path is a severe bug.
Hence complain loudly if that happens.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Bart Van Assche authored and Martin K. Petersen committed Aug 13, 2019
1 parent 0dcec41 commit 8826320
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ qla2x00_async_iocb_timeout(void *data)
sp->done(sp, QLA_FUNCTION_TIMEOUT);
}
break;
default:
WARN_ON_ONCE(true);
sp->done(sp, QLA_FUNCTION_TIMEOUT);
break;
}
}

Expand Down
4 changes: 4 additions & 0 deletions drivers/scsi/qla2xxx/qla_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2786,6 +2786,8 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)

if (rsp->status_srb == NULL)
sp->done(sp, res);
else
WARN_ON_ONCE(true);
}

/**
Expand Down Expand Up @@ -2843,6 +2845,8 @@ qla2x00_status_cont_entry(struct rsp_que *rsp, sts_cont_entry_t *pkt)
if (sense_len == 0) {
rsp->status_srb = NULL;
sp->done(sp, cp->result);
} else {
WARN_ON_ONCE(true);
}
}

Expand Down
4 changes: 4 additions & 0 deletions drivers/scsi/qla2xxx/qla_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,8 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)

if (rsp->status_srb == NULL)
sp->done(sp, res);
else
WARN_ON_ONCE(true);
}

/**
Expand Down Expand Up @@ -2616,6 +2618,8 @@ qlafx00_status_cont_entry(struct rsp_que *rsp, sts_cont_entry_t *pkt)
if (sense_len == 0) {
rsp->status_srb = NULL;
sp->done(sp, cp->result);
} else {
WARN_ON_ONCE(true);
}
}

Expand Down

0 comments on commit 8826320

Please sign in to comment.