Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: fnic: Do not call 'scsi_done()' for unhandled commands

The fnic drivers assigns an ioreq structure to each command and severs this
assignment once scsi_done() has been called and the command has been
completed.

When traversing commands to terminate outstanding I/O we should not call
scsi_done() on commands which do not have a corresponding ioreq structure;
these commands have either never entered the driver or have already been
completed.

[mkp: fixed unused label warning]

Link: https://lore.kernel.org/r/20200515112647.49260-1-hare@suse.de
Reported-by: kbuild test robot <lkp@intel.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Acked-by: Satish Kharat <satishkh@cisco.com>
Acked-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Hannes Reinecke and committed by
Martin K. Petersen
712582e6 6500251e

+1 -2
+1 -2
drivers/scsi/fnic/fnic_scsi.c
··· 1402 1402 } 1403 1403 if (!io_req) { 1404 1404 spin_unlock_irqrestore(io_lock, flags); 1405 - goto cleanup_scsi_cmd; 1405 + continue; 1406 1406 } 1407 1407 1408 1408 CMD_SP(sc) = NULL; ··· 1417 1417 fnic_release_ioreq_buf(fnic, io_req, sc); 1418 1418 mempool_free(io_req, fnic->io_req_pool); 1419 1419 1420 - cleanup_scsi_cmd: 1421 1420 sc->result = DID_TRANSPORT_DISRUPTED << 16; 1422 1421 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, 1423 1422 "%s: tag:0x%x : sc:0x%p duration = %lu DID_TRANSPORT_DISRUPTED\n",