diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2009-01-22 12:45:28 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-01-25 08:55:42 -0500 |
commit | 6e9f21f3d3d4933087d1e13b04667b6eb663b487 (patch) | |
tree | e54772e0611c8ecce820b4f624b0a7101a0f02ba /drivers/scsi | |
parent | 41bbdbebbbe7e06871d25f51c2eb1d6466bb9e5f (diff) |
[SCSI] qla2xxx: Fix memory leak in error path
Reviewed-by: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index cf32653fe01a..185ea8bcb9e2 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1888,6 +1888,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1888 | "[ERROR] Failed to allocate memory for scsi_host\n"); | 1888 | "[ERROR] Failed to allocate memory for scsi_host\n"); |
1889 | 1889 | ||
1890 | ret = -ENOMEM; | 1890 | ret = -ENOMEM; |
1891 | qla2x00_mem_free(ha); | ||
1892 | qla2x00_free_que(ha, req, rsp); | ||
1891 | goto probe_hw_failed; | 1893 | goto probe_hw_failed; |
1892 | } | 1894 | } |
1893 | 1895 | ||
@@ -1917,14 +1919,13 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1917 | /* Set up the irqs */ | 1919 | /* Set up the irqs */ |
1918 | ret = qla2x00_request_irqs(ha, rsp); | 1920 | ret = qla2x00_request_irqs(ha, rsp); |
1919 | if (ret) | 1921 | if (ret) |
1920 | goto probe_failed; | 1922 | goto probe_init_failed; |
1921 | |||
1922 | /* Alloc arrays of request and response ring ptrs */ | 1923 | /* Alloc arrays of request and response ring ptrs */ |
1923 | if (!qla2x00_alloc_queues(ha)) { | 1924 | if (!qla2x00_alloc_queues(ha)) { |
1924 | qla_printk(KERN_WARNING, ha, | 1925 | qla_printk(KERN_WARNING, ha, |
1925 | "[ERROR] Failed to allocate memory for queue" | 1926 | "[ERROR] Failed to allocate memory for queue" |
1926 | " pointers\n"); | 1927 | " pointers\n"); |
1927 | goto probe_failed; | 1928 | goto probe_init_failed; |
1928 | } | 1929 | } |
1929 | ha->rsp_q_map[0] = rsp; | 1930 | ha->rsp_q_map[0] = rsp; |
1930 | ha->req_q_map[0] = req; | 1931 | ha->req_q_map[0] = req; |
@@ -1997,6 +1998,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1997 | 1998 | ||
1998 | return 0; | 1999 | return 0; |
1999 | 2000 | ||
2001 | probe_init_failed: | ||
2002 | qla2x00_free_que(ha, req, rsp); | ||
2003 | ha->max_queues = 0; | ||
2004 | |||
2000 | probe_failed: | 2005 | probe_failed: |
2001 | qla2x00_free_device(base_vha); | 2006 | qla2x00_free_device(base_vha); |
2002 | 2007 | ||