summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2018-11-26 16:39:47 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-13 08:51:53 +0100
commit0e6ec8b39105ef5f63a9af25a60fc2f7d2a682a2 (patch)
tree0119b9aab44d32936235f073a5f54c5438560417
parenta4d121d90e28daf1619781ee1eb098705a474ec9 (diff)
nvme: Free ctrl device name on init failure
[ Upstream commit d6a2b9535d1e52bea269c138614c4801469d10e1 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-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 c4ff4f079448..b2d9bd564960 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3652,7 +3652,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: