From db3ad7f8852cfdfa03f72b27472e5a8bc9c1e1cf Mon Sep 17 00:00:00 2001 From: Giridhar Malavali Date: Thu, 18 Feb 2010 10:07:24 -0800 Subject: [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 Signed-off-by: James Bottomley --- drivers/scsi/qla2xxx/qla_os.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/qla2xxx/qla_os.c') 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); + } } } } -- cgit v1.2.2