* [PATCH] nvme: Free ctrl device name on init failure
@ 2018-11-26 23:39 Keith Busch
2018-11-27 7:36 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Keith Busch @ 2018-11-26 23:39 UTC (permalink / raw)
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 at intel.com>
---
drivers/nvme/host/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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:
--
2.14.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-27 7:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-26 23:39 [PATCH] nvme: Free ctrl device name on init failure Keith Busch
2018-11-27 7:36 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.