Commit 3dae2205 authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: Use common routine to free fcport struct

This patch does not change any any functionality.

Link: https://lore.kernel.org/r/20191217220617.28084-8-hmadhani@marvell.comSigned-off-by: default avatarQuinn Tran <qutran@marvell.com>
Signed-off-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 42521564
...@@ -54,7 +54,8 @@ void qla2x00_bsg_sp_free(srb_t *sp) ...@@ -54,7 +54,8 @@ void qla2x00_bsg_sp_free(srb_t *sp)
if (sp->type == SRB_CT_CMD || if (sp->type == SRB_CT_CMD ||
sp->type == SRB_FXIOCB_BCMD || sp->type == SRB_FXIOCB_BCMD ||
sp->type == SRB_ELS_CMD_HST) sp->type == SRB_ELS_CMD_HST)
kfree(sp->fcport); qla2x00_free_fcport(sp->fcport);
qla2x00_rel_sp(sp); qla2x00_rel_sp(sp);
} }
...@@ -405,7 +406,7 @@ qla2x00_process_els(struct bsg_job *bsg_job) ...@@ -405,7 +406,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
done_free_fcport: done_free_fcport:
if (bsg_request->msgcode == FC_BSG_RPT_ELS) if (bsg_request->msgcode == FC_BSG_RPT_ELS)
kfree(fcport); qla2x00_free_fcport(fcport);
done: done:
return rval; return rval;
} }
...@@ -545,7 +546,7 @@ qla2x00_process_ct(struct bsg_job *bsg_job) ...@@ -545,7 +546,7 @@ qla2x00_process_ct(struct bsg_job *bsg_job)
return rval; return rval;
done_free_fcport: done_free_fcport:
kfree(fcport); qla2x00_free_fcport(fcport);
done_unmap_sg: done_unmap_sg:
dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list,
bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE);
...@@ -2049,7 +2050,7 @@ qlafx00_mgmt_cmd(struct bsg_job *bsg_job) ...@@ -2049,7 +2050,7 @@ qlafx00_mgmt_cmd(struct bsg_job *bsg_job)
return rval; return rval;
done_free_fcport: done_free_fcport:
kfree(fcport); qla2x00_free_fcport(fcport);
done_unmap_rsp_sg: done_unmap_rsp_sg:
if (piocb_rqst->flags & SRB_FXDISC_RESP_DMA_VALID) if (piocb_rqst->flags & SRB_FXDISC_RESP_DMA_VALID)
......
...@@ -198,6 +198,7 @@ extern void qla2x00_free_host(struct scsi_qla_host *); ...@@ -198,6 +198,7 @@ extern void qla2x00_free_host(struct scsi_qla_host *);
extern void qla2x00_relogin(struct scsi_qla_host *); extern void qla2x00_relogin(struct scsi_qla_host *);
extern void qla2x00_do_work(struct scsi_qla_host *); extern void qla2x00_do_work(struct scsi_qla_host *);
extern void qla2x00_free_fcports(struct scsi_qla_host *); extern void qla2x00_free_fcports(struct scsi_qla_host *);
extern void qla2x00_free_fcport(fc_port_t *);
extern void qla83xx_schedule_work(scsi_qla_host_t *, int); extern void qla83xx_schedule_work(scsi_qla_host_t *, int);
extern void qla83xx_service_idc_aen(struct work_struct *); extern void qla83xx_service_idc_aen(struct work_struct *);
......
...@@ -5246,7 +5246,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha) ...@@ -5246,7 +5246,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha)
} }
cleanup_allocation: cleanup_allocation:
kfree(new_fcport); qla2x00_free_fcport(new_fcport);
if (rval != QLA_SUCCESS) { if (rval != QLA_SUCCESS) {
ql_dbg(ql_dbg_disc, vha, 0x2098, ql_dbg(ql_dbg_disc, vha, 0x2098,
......
...@@ -1212,7 +1212,7 @@ qlafx00_find_all_targets(scsi_qla_host_t *vha, ...@@ -1212,7 +1212,7 @@ qlafx00_find_all_targets(scsi_qla_host_t *vha,
fcport->old_tgt_id); fcport->old_tgt_id);
qla2x00_mark_device_lost(vha, fcport, 0); qla2x00_mark_device_lost(vha, fcport, 0);
set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
kfree(new_fcport); qla2x00_free_fcport(new_fcport);
return rval; return rval;
} }
break; break;
...@@ -1230,7 +1230,7 @@ qlafx00_find_all_targets(scsi_qla_host_t *vha, ...@@ -1230,7 +1230,7 @@ qlafx00_find_all_targets(scsi_qla_host_t *vha,
return QLA_MEMORY_ALLOC_FAILED; return QLA_MEMORY_ALLOC_FAILED;
} }
kfree(new_fcport); qla2x00_free_fcport(new_fcport);
return rval; return rval;
} }
...@@ -1298,7 +1298,7 @@ qlafx00_configure_all_targets(scsi_qla_host_t *vha) ...@@ -1298,7 +1298,7 @@ qlafx00_configure_all_targets(scsi_qla_host_t *vha)
/* Free all new device structures not processed. */ /* Free all new device structures not processed. */
list_for_each_entry_safe(fcport, rmptemp, &new_fcports, list) { list_for_each_entry_safe(fcport, rmptemp, &new_fcports, list) {
list_del(&fcport->list); list_del(&fcport->list);
kfree(fcport); qla2x00_free_fcport(fcport);
} }
return rval; return rval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment