Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6a2b953 authored by Keith Busch's avatar Keith Busch Committed by Christoph Hellwig
Browse files

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: d22524a4 ("nvme: switch controller refcounting to use struct device")
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 14b04063
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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: