Skip to content

Commit 04dfaa5

Browse files
Mauricio Faria de Oliveiramartinkpetersen
authored andcommitted
scsi: qla2xxx: do not queue commands when unloading
When the driver is unloading, in qla2x00_remove_one(), there is a single call/point in time to abort ongoing commands, qla2x00_abort_all_cmds(), which is still several steps away from the call to scsi_remove_host(). If more commands continue to arrive and be processed during that interval, when the driver is tearing down and releasing its structures, it might potentially hit an oops due to invalid memory access: Unable to handle kernel paging request for data at address 0x00000138 <...> NIP [d000000004700a40] qla2xxx_queuecommand+0x80/0x3f0 [qla2xxx] LR [d000000004700a10] qla2xxx_queuecommand+0x50/0x3f0 [qla2xxx] So, fail commands in qla2xxx_queuecommand() if the UNLOADING bit is set. Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com> Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 69e2d1e commit 04dfaa5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,11 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
707707
srb_t *sp;
708708
int rval;
709709

710+
if (unlikely(test_bit(UNLOADING, &base_vha->dpc_flags))) {
711+
cmd->result = DID_NO_CONNECT << 16;
712+
goto qc24_fail_command;
713+
}
714+
710715
if (ha->flags.eeh_busy) {
711716
if (ha->flags.pci_channel_io_perm_failure) {
712717
ql_dbg(ql_dbg_aer, vha, 0x9010,

0 commit comments

Comments
 (0)