aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
authorGiridhar Malavali <giridhar.malavali@qlogic.com>2010-02-18 13:07:24 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-02-19 11:44:52 -0500
commitdb3ad7f8852cfdfa03f72b27472e5a8bc9c1e1cf (patch)
treecf71e747b4844cf20e73fd582ee63d38ec7e0080 /drivers/scsi/qla2xxx/qla_os.c
parent236b0249c2274cd24bc98a1fbbb5e78d861d4bd9 (diff)
[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.c15
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)
1160 qla2x00_sp_compl(ha, sp); 1160 qla2x00_sp_compl(ha, sp);
1161 } else { 1161 } else {
1162 ctx = sp->ctx; 1162 ctx = sp->ctx;
1163 del_timer_sync(&ctx->timer); 1163 if (ctx->type == SRB_LOGIN_CMD || ctx->type == SRB_LOGOUT_CMD) {
1164 ctx->free(sp); 1164 del_timer_sync(&ctx->timer);
1165 ctx->free(sp);
1166 } else {
1167 struct srb_bsg* sp_bsg = (struct srb_bsg*)sp->ctx;
1168 if (sp_bsg->bsg_job->request->msgcode == FC_BSG_HST_CT)
1169 kfree(sp->fcport);
1170 sp_bsg->bsg_job->req->errors = 0;
1171 sp_bsg->bsg_job->reply->result = res;
1172 sp_bsg->bsg_job->job_done(sp_bsg->bsg_job);
1173 kfree(sp->ctx);
1174 mempool_free(sp, ha->srb_mempool);
1175 }
1165 } 1176 }
1166 } 1177 }
1167 } 1178 }