mirror of
https://github.com/torvalds/linux.git
synced 2025-11-09 05:00:09 +02:00
There is warning report about of_node refcount leak
while probing mdio device:
OF: ERROR: memory leak, expected refcount 1 instead of 2,
of_node_get()/of_node_put() unbalanced - destroy cset entry:
attach overlay node /spi/soc@0/mdio@710700c0/ethernet@4
In of_mdiobus_register_device(), we increase fwnode refcount
by fwnode_handle_get() before associating the of_node with
mdio device, but it has never been decreased in normal path.
Since that, in mdio_device_release(), it needs to call
fwnode_handle_put() in addition instead of calling kfree()
directly.
After above, just calling mdio_device_free() in the error handle
path of of_mdiobus_register_device() is enough to keep the
refcount balanced.
Fixes:
|
||
|---|---|---|
| .. | ||
| acpi_mdio.c | ||
| fwnode_mdio.c | ||
| Kconfig | ||
| Makefile | ||
| mdio-aspeed.c | ||
| mdio-bcm-iproc.c | ||
| mdio-bcm-unimac.c | ||
| mdio-bitbang.c | ||
| mdio-cavium.c | ||
| mdio-cavium.h | ||
| mdio-gpio.c | ||
| mdio-hisi-femac.c | ||
| mdio-i2c.c | ||
| mdio-ipq4019.c | ||
| mdio-ipq8064.c | ||
| mdio-moxart.c | ||
| mdio-mscc-miim.c | ||
| mdio-mux-bcm-iproc.c | ||
| mdio-mux-bcm6368.c | ||
| mdio-mux-gpio.c | ||
| mdio-mux-meson-g12a.c | ||
| mdio-mux-mmioreg.c | ||
| mdio-mux-multiplexer.c | ||
| mdio-mux.c | ||
| mdio-mvusb.c | ||
| mdio-octeon.c | ||
| mdio-sun4i.c | ||
| mdio-thunder.c | ||
| mdio-xgene.c | ||
| of_mdio.c | ||