diff options
author | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-09-19 21:14:53 (GMT) |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-11-04 19:53:04 (GMT) |
commit | 684f5c2025b067a23722e620d0b3b858d8dc5d01 (patch) | |
tree | 3e1874b9a601d5dc9ff57a1ddf0221ca89904455 /drivers/block/nvme.c | |
parent | d1a490e026efb22851ed60588b5fad1281d80ec3 (diff) | |
download | linux-fsl-qoriq-684f5c2025b067a23722e620d0b3b858d8dc5d01.tar.xz |
NVMe: Fix memory leak in nvme_dev_add()
The driver was allocating 8k of memory, then freeing 4k of it.
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block/nvme.c')
-rw-r--r-- | drivers/block/nvme.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index a7f82fb..705f66e 100644 --- a/drivers/block/nvme.c +++ b/drivers/block/nvme.c @@ -1457,7 +1457,7 @@ static int __devinit nvme_dev_add(struct nvme_dev *dev) list_for_each_entry(ns, &dev->namespaces, list) add_disk(ns->disk); - dma_free_coherent(&dev->pci_dev->dev, 4096, id, dma_addr); + dma_free_coherent(&dev->pci_dev->dev, 8192, id, dma_addr); return 0; out_free: @@ -1466,7 +1466,7 @@ static int __devinit nvme_dev_add(struct nvme_dev *dev) nvme_ns_free(ns); } - dma_free_coherent(&dev->pci_dev->dev, 4096, id, dma_addr); + dma_free_coherent(&dev->pci_dev->dev, 8192, mem, dma_addr); return res; } |