提交 684f5c20 编写于 作者: M Matthew Wilcox

NVMe: Fix memory leak in nvme_dev_add()

The driver was allocating 8k of memory, then freeing 4k of it.
Signed-off-by: NMatthew Wilcox <matthew.r.wilcox@intel.com>
上级 d1a490e0
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册