[SCSI] qla2xxx: Clean up qla24xx_iidma()
[pandora-kernel.git] / drivers / scsi / qla2xxx / qla_bsg.c
index 39719f8..9a30b69 100644 (file)
@@ -1282,14 +1282,7 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
                return -EINVAL;
        }
 
-       port_param = (struct qla_port_param *)((char *)bsg_job->request +
-               sizeof(struct fc_bsg_request));
-       if (!port_param) {
-               ql_log(ql_log_warn, vha, 0x7047,
-                   "port_param header not provided.\n");
-               return -EINVAL;
-       }
-
+       port_param = (void *)bsg_job->request + sizeof(struct fc_bsg_request);
        if (port_param->fc_scsi_addr.dest_type != EXT_DEF_TYPE_WWPN) {
                ql_log(ql_log_warn, vha, 0x7048,
                    "Invalid destination type.\n");
@@ -2153,6 +2146,7 @@ qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job)
                                        (sp->type == SRB_ELS_CMD_HST) ||
                                        (sp->type == SRB_FXIOCB_BCMD))
                                        && (sp->u.bsg_job == bsg_job)) {
+                                       req->outstanding_cmds[cnt] = NULL;
                                        spin_unlock_irqrestore(&ha->hardware_lock, flags);
                                        if (ha->isp_ops->abort_command(sp)) {
                                                ql_log(ql_log_warn, vha, 0x7089,
@@ -2180,8 +2174,6 @@ qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job)
 
 done:
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
-       if (bsg_job->request->msgcode == FC_BSG_HST_CT)
-               kfree(sp->fcport);
-       qla2x00_rel_sp(vha, sp);
+       sp->free(vha, sp);
        return 0;
 }