Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 7588a511bdb4 ("slimbus: core: add support to device tree helper")
Fixes: 01360857486c ("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>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
0b52edae aa3f64a9

+1 -1
+1 -1
drivers/slimbus/core.c
··· 146 146 { 147 147 struct slim_device *sbdev = to_slim_device(dev); 148 148 149 + of_node_put(sbdev->dev.of_node); 149 150 kfree(sbdev); 150 151 } 151 152 ··· 281 280 /* slim_remove_device: Remove the effect of slim_add_device() */ 282 281 static void slim_remove_device(struct slim_device *sbdev) 283 282 { 284 - of_node_put(sbdev->dev.of_node); 285 283 device_unregister(&sbdev->dev); 286 284 } 287 285