aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2013-05-01 15:07:49 -0400
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-05-02 14:36:45 -0400
commitcbb6218fd4ae8f98ddf0d66f0826a7a3a9c88298 (patch)
tree98e8476300d76e97c274307b1534476d9c9e5075
parenta9ef4343afbe67a6abf83c0f0294e80db48e513a (diff)
NVMe: Remove dead code in nvme_dev_add
There is no situation that could occur where we could error out of this function and require cleaning up allocated namespaces. Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
-rw-r--r--drivers/block/nvme-core.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 2d4f2ae36d31..a126c7b9dbea 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -1515,7 +1515,7 @@ static void nvme_free_queues(struct nvme_dev *dev)
1515static int nvme_dev_add(struct nvme_dev *dev) 1515static int nvme_dev_add(struct nvme_dev *dev)
1516{ 1516{
1517 int res, nn, i; 1517 int res, nn, i;
1518 struct nvme_ns *ns, *next; 1518 struct nvme_ns *ns;
1519 struct nvme_id_ctrl *ctrl; 1519 struct nvme_id_ctrl *ctrl;
1520 struct nvme_id_ns *id_ns; 1520 struct nvme_id_ns *id_ns;
1521 void *mem; 1521 void *mem;
@@ -1533,7 +1533,7 @@ static int nvme_dev_add(struct nvme_dev *dev)
1533 res = nvme_identify(dev, 0, 1, dma_addr); 1533 res = nvme_identify(dev, 0, 1, dma_addr);
1534 if (res) { 1534 if (res) {
1535 res = -EIO; 1535 res = -EIO;
1536 goto out_free; 1536 goto out;
1537 } 1537 }
1538 1538
1539 ctrl = mem; 1539 ctrl = mem;
@@ -1568,13 +1568,6 @@ static int nvme_dev_add(struct nvme_dev *dev)
1568 list_for_each_entry(ns, &dev->namespaces, list) 1568 list_for_each_entry(ns, &dev->namespaces, list)
1569 add_disk(ns->disk); 1569 add_disk(ns->disk);
1570 res = 0; 1570 res = 0;
1571 goto out;
1572
1573 out_free:
1574 list_for_each_entry_safe(ns, next, &dev->namespaces, list) {
1575 list_del(&ns->list);
1576 nvme_ns_free(ns);
1577 }
1578 1571
1579 out: 1572 out:
1580 dma_free_coherent(&dev->pci_dev->dev, 8192, mem, dma_addr); 1573 dma_free_coherent(&dev->pci_dev->dev, 8192, mem, dma_addr);