Skip to content

Commit 0b52eda

Browse files
jhovoldgregkh
authored andcommitted
slimbus: core: fix OF node leak on registration failure
Make sure to drop the OF node reference taken when initialising and registering the slimbus device also on registration failure by releasing it in the destructor as expected. Fixes: 7588a51 ("slimbus: core: add support to device tree helper") Fixes: 0136085 ("slimbus: core: Fix mismatch in of_node_get/put") Cc: Saravana Kannan <saravanak@google.com> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20251126145329.5022-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent aa3f64a commit 0b52eda

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/slimbus/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ static void slim_dev_release(struct device *dev)
146146
{
147147
struct slim_device *sbdev = to_slim_device(dev);
148148

149+
of_node_put(sbdev->dev.of_node);
149150
kfree(sbdev);
150151
}
151152

@@ -280,7 +281,6 @@ EXPORT_SYMBOL_GPL(slim_register_controller);
280281
/* slim_remove_device: Remove the effect of slim_add_device() */
281282
static void slim_remove_device(struct slim_device *sbdev)
282283
{
283-
of_node_put(sbdev->dev.of_node);
284284
device_unregister(&sbdev->dev);
285285
}
286286

0 commit comments

Comments
 (0)