diff options
author | Giridhar Malavali <giridhar.malavali@qlogic.com> | 2011-11-18 09:03:08 -0800 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-12-15 10:55:02 +0400 |
commit | c4631191c44de9567ac5376e6a7f4a244c2283bc (patch) | |
tree | a3e12ef92fb4d2f0177158b71d47f88d85dbfea1 /drivers/scsi/qla2xxx/qla_os.c | |
parent | cfb0919c12a33132f75fb91971bbd8bdd44ebb90 (diff) | |
download | blackbird-op-linux-c4631191c44de9567ac5376e6a7f4a244c2283bc.tar.gz blackbird-op-linux-c4631191c44de9567ac5376e6a7f4a244c2283bc.zip |
[SCSI] qla2xxx: Proper cleanup of pass through commands when firmware returns error.
[jejb: fixed up checkpatch and casting errors]
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index ae1699f6854d..c9a74521b402 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3690,16 +3690,6 @@ qla2x00_sp_free_dma(srb_t *sp) sp->flags &= ~SRB_CRC_CTX_DMA_VALID; } - CMD_SP(cmd) = NULL; -} - -static void -qla2x00_sp_final_compl(struct qla_hw_data *ha, srb_t *sp) -{ - struct scsi_cmnd *cmd = sp->cmd; - - qla2x00_sp_free_dma(sp); - if (sp->flags & SRB_FCP_CMND_DMA_VALID) { struct ct6_dsd *ctx = sp->ctx; dma_pool_free(ha->fcp_cmnd_dma_pool, ctx->fcp_cmnd, @@ -3711,6 +3701,15 @@ qla2x00_sp_final_compl(struct qla_hw_data *ha, srb_t *sp) sp->ctx = NULL; } + CMD_SP(cmd) = NULL; +} + +static void +qla2x00_sp_final_compl(struct qla_hw_data *ha, srb_t *sp) +{ + struct scsi_cmnd *cmd = sp->cmd; + + qla2x00_sp_free_dma(sp); mempool_free(sp, ha->srb_mempool); cmd->scsi_done(cmd); } |