summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2018-11-26 16:39:47 -0700
committerChristoph Hellwig <hch@lst.de>2018-11-27 08:35:15 +0100
commitd6a2b9535d1e52bea269c138614c4801469d10e1 (patch)
tree79c017288b71557b533a607da61142f0107c99cb /drivers/nvme
parent14b04063cc994effc86f976625bf8f806d8d44cb (diff)
downloadlinux-stable-d6a2b9535d1e52bea269c138614c4801469d10e1.tar.gz
linux-stable-d6a2b9535d1e52bea269c138614c4801469d10e1.tar.bz2
linux-stable-d6a2b9535d1e52bea269c138614c4801469d10e1.zip
nvme: Free ctrl device name on init failure
Free the kobject name that was allocated for the controller device on failure rather than its parent. Fixes: d22524a4782a9 ("nvme: switch controller refcounting to use struct device") Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 559d567693b8..5afda6fe5ae9 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3585,7 +3585,7 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
return 0;
out_free_name:
- kfree_const(dev->kobj.name);
+ kfree_const(ctrl->device->kobj.name);
out_release_instance:
ida_simple_remove(&nvme_instance_ida, ctrl->instance);
out: