Skip to content

Commit 9cdae71

Browse files
committed
driver core: auxiliary bus: fix OF node leak
JIRA: https://issues.redhat.com/browse/RHEL-109251 commit 6beb4ec Author: Johan Hovold <johan@kernel.org> Date: Wed, 16 Jul 2025 13:40:39 +0000 Make sure to drop the OF node reference taken when creating an auxiliary device using auxiliary_device_create() when the device is later released. Fixes: eaa0d30 ("driver core: auxiliary bus: add device creation helpers") Cc: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://lore.kernel.org/r/20250708084654.15145-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent 8a007d6 commit 9cdae71

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/base/auxiliary.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ static void auxiliary_device_release(struct device *dev)
399399
{
400400
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
401401

402+
of_node_put(dev->of_node);
402403
kfree(auxdev);
403404
}
404405

@@ -435,6 +436,7 @@ struct auxiliary_device *auxiliary_device_create(struct device *dev,
435436

436437
ret = auxiliary_device_init(auxdev);
437438
if (ret) {
439+
of_node_put(auxdev->dev.of_node);
438440
kfree(auxdev);
439441
return NULL;
440442
}

0 commit comments

Comments
 (0)