summaryrefslogtreecommitdiffstats
path: root/drivers/block/nvme-core.c
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2013-05-01 13:07:49 -0600
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2013-05-02 14:36:45 -0400
commitcbb6218fd4ae8f98ddf0d66f0826a7a3a9c88298 (patch)
tree98e8476300d76e97c274307b1534476d9c9e5075 /drivers/block/nvme-core.c
parenta9ef4343afbe67a6abf83c0f0294e80db48e513a (diff)
downloadop-kernel-dev-cbb6218fd4ae8f98ddf0d66f0826a7a3a9c88298.zip
op-kernel-dev-cbb6218fd4ae8f98ddf0d66f0826a7a3a9c88298.tar.gz
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>
Diffstat (limited to 'drivers/block/nvme-core.c')
-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 2d4f2ae..a126c7b 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)
static int nvme_dev_add(struct nvme_dev *dev)
{
int res, nn, i;
- struct nvme_ns *ns, *next;
+ struct nvme_ns *ns;
struct nvme_id_ctrl *ctrl;
struct nvme_id_ns *id_ns;
void *mem;
@@ -1533,7 +1533,7 @@ static int nvme_dev_add(struct nvme_dev *dev)
res = nvme_identify(dev, 0, 1, dma_addr);
if (res) {
res = -EIO;
- goto out_free;
+ goto out;
}
ctrl = mem;
@@ -1568,13 +1568,6 @@ static int nvme_dev_add(struct nvme_dev *dev)
list_for_each_entry(ns, &dev->namespaces, list)
add_disk(ns->disk);
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:
dma_free_coherent(&dev->pci_dev->dev, 8192, mem, dma_addr);
OpenPOWER on IntegriCloud