Commit cbb6218f authored by Keith Busch's avatar Keith Busch Committed by Matthew Wilcox

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: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarMatthew Wilcox <matthew.r.wilcox@intel.com>
parent a9ef4343
...@@ -1515,7 +1515,7 @@ static void nvme_free_queues(struct nvme_dev *dev) ...@@ -1515,7 +1515,7 @@ static void nvme_free_queues(struct nvme_dev *dev)
static int nvme_dev_add(struct nvme_dev *dev) static int nvme_dev_add(struct nvme_dev *dev)
{ {
int res, nn, i; int res, nn, i;
struct nvme_ns *ns, *next; struct nvme_ns *ns;
struct nvme_id_ctrl *ctrl; struct nvme_id_ctrl *ctrl;
struct nvme_id_ns *id_ns; struct nvme_id_ns *id_ns;
void *mem; void *mem;
...@@ -1533,7 +1533,7 @@ static int nvme_dev_add(struct nvme_dev *dev) ...@@ -1533,7 +1533,7 @@ static int nvme_dev_add(struct nvme_dev *dev)
res = nvme_identify(dev, 0, 1, dma_addr); res = nvme_identify(dev, 0, 1, dma_addr);
if (res) { if (res) {
res = -EIO; res = -EIO;
goto out_free; goto out;
} }
ctrl = mem; ctrl = mem;
...@@ -1568,13 +1568,6 @@ static int nvme_dev_add(struct nvme_dev *dev) ...@@ -1568,13 +1568,6 @@ static int nvme_dev_add(struct nvme_dev *dev)
list_for_each_entry(ns, &dev->namespaces, list) list_for_each_entry(ns, &dev->namespaces, list)
add_disk(ns->disk); add_disk(ns->disk);
res = 0; res = 0;
goto out;
out_free:
list_for_each_entry_safe(ns, next, &dev->namespaces, list) {
list_del(&ns->list);
nvme_ns_free(ns);
}
out: out:
dma_free_coherent(&dev->pci_dev->dev, 8192, mem, dma_addr); dma_free_coherent(&dev->pci_dev->dev, 8192, mem, dma_addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment