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.

amba: bus: fix refcount leak

commit 5de1540b7bc4 ("drivers/amba: create devices from device tree")
increases the refcount of of_node, but not releases it in
amba_device_release, so there is refcount leak. By using of_node_put
to avoid refcount leak.

Fixes: 5de1540b7bc4 ("drivers/amba: create devices from device tree")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230821023928.3324283-1-peng.fan@oss.nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Peng Fan and committed by
Greg Kroah-Hartman
e312cbdc df8e2c3e

+1
+1
drivers/amba/bus.c
··· 528 528 { 529 529 struct amba_device *d = to_amba_device(dev); 530 530 531 + of_node_put(d->dev.of_node); 531 532 if (d->res.parent) 532 533 release_resource(&d->res); 533 534 mutex_destroy(&d->periphid_lock);