[12/21] snic: check for started requests in snic_hba_reset_cmpl_handler()
diff mbox series

Message ID 20200703130122.111448-13-hare@suse.de
State Changes Requested
Headers show
  • scsi: enable reserved commands for LLDDs
Related show

Commit Message

Hannes Reinecke July 3, 2020, 1:01 p.m. UTC
snic_hba_reset_cmpl_handler() is using scsi_host_find_tag() to
map id to a scsi command. However, as per discussion on the mailinglist
scsi_host_find_tag() might return a non-started request, so we need
to check the returned command with blk_mq_request_started() to avoid
the function tripping over a non-initialized command.

Signed-off-by: Hannes Reinecke <hare@suse.de>
 drivers/scsi/snic/snic_scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c
index 9f9a497beb5c..b000a926e194 100644
--- a/drivers/scsi/snic/snic_scsi.c
+++ b/drivers/scsi/snic/snic_scsi.c
@@ -1020,7 +1020,7 @@  snic_hba_reset_cmpl_handler(struct snic *snic, struct snic_fw_req *fwreq)
 	sc = scsi_host_find_tag(snic->shost, cmnd_id);
-	if (!sc) {
+	if (!sc || !blk_mq_request_started(sc->request)) {
 			      "reset_cmpl: sc is NULL - Hdr Stat %s Tag 0x%x\n",