diff options
author | Prasanna Mumbai <prasanna.mumbai@qlogic.com> | 2010-07-10 14:49:38 +0530 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 12:04:34 -0500 |
commit | beabe7c18338a5112fbca9a6dbcc921f9cce6325 (patch) | |
tree | 288d2d2e9013ff073ddd135e991eaced74b21887 /drivers/scsi/qla4xxx/ql4_mbx.c | |
parent | b966346c344f592c8e6a84c9c274a7dedbc057ad (diff) | |
download | op-kernel-dev-beabe7c18338a5112fbca9a6dbcc921f9cce6325.zip op-kernel-dev-beabe7c18338a5112fbca9a6dbcc921f9cce6325.tar.gz |
[SCSI] qla4xxx: Fix the freeing of the buffer allocated for DMA
Fixed the DMA allocated memory freeing which wasn't taken care
in many cases.
Signed-off-by: Prasanna Mumbai <prasanna.mumbai@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_mbx.c')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_mbx.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index 75496fb..54db6cb 100644 --- a/drivers/scsi/qla4xxx/ql4_mbx.c +++ b/drivers/scsi/qla4xxx/ql4_mbx.c @@ -317,7 +317,7 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha) if (init_fw_cb == NULL) { DEBUG2(printk("scsi%ld: %s: Unable to alloc init_cb\n", ha->host_no, __func__)); - return 10; + goto exit_init_fw_cb_no_free; } memset(init_fw_cb, 0, sizeof(struct addr_ctrl_blk)); @@ -373,7 +373,7 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha) exit_init_fw_cb: dma_free_coherent(&ha->pdev->dev, sizeof(struct addr_ctrl_blk), init_fw_cb, init_fw_cb_dma); - +exit_init_fw_cb_no_free: return status; } @@ -394,7 +394,7 @@ int qla4xxx_get_dhcp_ip_address(struct scsi_qla_host * ha) if (init_fw_cb == NULL) { printk("scsi%ld: %s: Unable to alloc init_cb\n", ha->host_no, __func__); - return 10; + return QLA_ERROR; } /* Get Initialize Firmware Control Block. */ @@ -1019,16 +1019,16 @@ int qla4xxx_send_tgts(struct scsi_qla_host *ha, char *ip, uint16_t port) DEBUG2(printk("scsi%ld: %s: Unable to allocate dma buffer.\n", ha->host_no, __func__)); ret_val = QLA_ERROR; - goto qla4xxx_send_tgts_exit; + goto exit_send_tgts_no_free; } ret_val = qla4xxx_get_default_ddb(ha, fw_ddb_entry_dma); if (ret_val != QLA_SUCCESS) - goto qla4xxx_send_tgts_exit; + goto exit_send_tgts; ret_val = qla4xxx_req_ddb_entry(ha, &ddb_index); if (ret_val != QLA_SUCCESS) - goto qla4xxx_send_tgts_exit; + goto exit_send_tgts; memset(fw_ddb_entry->iscsi_alias, 0, sizeof(fw_ddb_entry->iscsi_alias)); @@ -1050,9 +1050,10 @@ int qla4xxx_send_tgts(struct scsi_qla_host *ha, char *ip, uint16_t port) ret_val = qla4xxx_set_ddb_entry(ha, ddb_index, fw_ddb_entry_dma); -qla4xxx_send_tgts_exit: +exit_send_tgts: dma_free_coherent(&ha->pdev->dev, sizeof(*fw_ddb_entry), fw_ddb_entry, fw_ddb_entry_dma); +exit_send_tgts_no_free: return ret_val; } |