diff options
author | Giridhar Malavali <giridhar.malavali@qlogic.com> | 2010-02-18 10:07:24 -0800 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-02-19 10:44:52 -0600 |
commit | db3ad7f8852cfdfa03f72b27472e5a8bc9c1e1cf (patch) | |
tree | cf71e747b4844cf20e73fd582ee63d38ec7e0080 /drivers/scsi/qla2xxx/qla_os.c | |
parent | 236b0249c2274cd24bc98a1fbbb5e78d861d4bd9 (diff) | |
download | blackbird-op-linux-db3ad7f8852cfdfa03f72b27472e5a8bc9c1e1cf.tar.gz blackbird-op-linux-db3ad7f8852cfdfa03f72b27472e5a8bc9c1e1cf.zip |
[SCSI] qla2xxx: Proper clean-up of BSG requests when request times out.
Fix for BSG request cleanup when the request timesout.
Proper release of driver resources used for BSG request during timeout cleanup.
Cc: stable@kernel.org
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 82e57d778428..83615e71fa0d 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1160,8 +1160,19 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) qla2x00_sp_compl(ha, sp); } else { ctx = sp->ctx; - del_timer_sync(&ctx->timer); - ctx->free(sp); + if (ctx->type == SRB_LOGIN_CMD || ctx->type == SRB_LOGOUT_CMD) { + del_timer_sync(&ctx->timer); + ctx->free(sp); + } else { + struct srb_bsg* sp_bsg = (struct srb_bsg*)sp->ctx; + if (sp_bsg->bsg_job->request->msgcode == FC_BSG_HST_CT) + kfree(sp->fcport); + sp_bsg->bsg_job->req->errors = 0; + sp_bsg->bsg_job->reply->result = res; + sp_bsg->bsg_job->job_done(sp_bsg->bsg_job); + kfree(sp->ctx); + mempool_free(sp, ha->srb_mempool); + } } } } |