diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-11-01 21:52:17 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-12-03 04:46:07 -0500 |
commit | 51a1efe2e84493439db32c07471e835c752a7923 (patch) | |
tree | 7608eba539917e5b666c9f67a63aa82449aeb43e /drivers/dma | |
parent | cbeae41888bddb2d8c23db281de5f38f4be6a9bb (diff) |
dma: intel_mid_dma: fix double free on mid_setup_dma error path
We should not call kfree(dma) in mid_setup_dma error path because
the memory is allocated in intel_mid_dma_probe and will be freed
in intel_mid_dma_probe error path if mid_setup_dma return error.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/intel_mid_dma.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c index 338bc4eed1f3..4c55d451b613 100644 --- a/drivers/dma/intel_mid_dma.c +++ b/drivers/dma/intel_mid_dma.c | |||
@@ -1075,7 +1075,6 @@ static int mid_setup_dma(struct pci_dev *pdev) | |||
1075 | if (NULL == dma->dma_pool) { | 1075 | if (NULL == dma->dma_pool) { |
1076 | pr_err("ERR_MDMA:pci_pool_create failed\n"); | 1076 | pr_err("ERR_MDMA:pci_pool_create failed\n"); |
1077 | err = -ENOMEM; | 1077 | err = -ENOMEM; |
1078 | kfree(dma); | ||
1079 | goto err_dma_pool; | 1078 | goto err_dma_pool; |
1080 | } | 1079 | } |
1081 | 1080 | ||
@@ -1186,7 +1185,6 @@ err_engine: | |||
1186 | free_irq(pdev->irq, dma); | 1185 | free_irq(pdev->irq, dma); |
1187 | err_irq: | 1186 | err_irq: |
1188 | pci_pool_destroy(dma->dma_pool); | 1187 | pci_pool_destroy(dma->dma_pool); |
1189 | kfree(dma); | ||
1190 | err_dma_pool: | 1188 | err_dma_pool: |
1191 | pr_err("ERR_MDMA:setup_dma failed: %d\n", err); | 1189 | pr_err("ERR_MDMA:setup_dma failed: %d\n", err); |
1192 | return err; | 1190 | return err; |