diff options
author | Arun Easi <aeasi@marvell.com> | 2019-11-05 16:06:55 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-11-09 03:15:42 +0100 |
commit | 2f856d4e8c23f5ad5221f8da4a2f22d090627f19 (patch) | |
tree | 92ad302eb83b1fae059e815df1c49965d93aa4c4 /drivers/scsi/qla2xxx | |
parent | scsi: qla2xxx: Fix double scsi_done for abort path (diff) | |
download | linux-2f856d4e8c23f5ad5221f8da4a2f22d090627f19.tar.xz linux-2f856d4e8c23f5ad5221f8da4a2f22d090627f19.zip |
scsi: qla2xxx: Fix memory leak when sending I/O fails
On heavy loads, a memory leak of the srb_t structure is observed. This
would make the qla2xxx_srbs cache gobble up memory.
Fixes: 219d27d7147e0 ("scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands")
Cc: stable@vger.kernel.org # 5.2
Link: https://lore.kernel.org/r/20191105150657.8092-7-hmadhani@marvell.com
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 48e7b36f5513..f5c660b4a16c 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -909,6 +909,8 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) qc24_host_busy_free_sp: sp->free(sp); + CMD_SP(cmd) = NULL; + qla2x00_rel_sp(sp); qc24_target_busy: return SCSI_MLQUEUE_TARGET_BUSY; @@ -992,6 +994,8 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, qc24_host_busy_free_sp: sp->free(sp); + CMD_SP(cmd) = NULL; + qla2xxx_rel_qpair_sp(sp->qpair, sp); qc24_target_busy: return SCSI_MLQUEUE_TARGET_BUSY; |