Message ID | 20241024015909.58654-3-zhangzekun11@huawei.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Get the device_node before calling of_find_node_by_name() | expand |
On Thu, Oct 24, 2024 at 09:59:09AM +0800, Zhang Zekun wrote: > of_find_node_by_name() will decrease the refount of the device_node. > So, get the device_node before passing to it. > > Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver") > Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> Acked-by: Oleksij Rempel <o.rempel@pengutronix.de> Thank you!
On Thu, 24 Oct 2024 09:59:09 +0800 Zhang Zekun <zhangzekun11@huawei.com> wrote: > of_find_node_by_name() will decrease the refount of the device_node. > So, get the device_node before passing to it. > > Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver") > Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> Acked-by: Kory Maincent <kory.maincent@bootlin.com> Thank you!
diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c index 5c4e88be46ee..f5c04dd5be37 100644 --- a/drivers/net/pse-pd/tps23881.c +++ b/drivers/net/pse-pd/tps23881.c @@ -216,6 +216,7 @@ tps23881_get_of_channels(struct tps23881_priv *priv, if (!priv->np) return -EINVAL; + of_node_get(priv->np); channels_node = of_find_node_by_name(priv->np, "channels"); if (!channels_node) return -EINVAL;
of_find_node_by_name() will decrease the refount of the device_node. So, get the device_node before passing to it. Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver") Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> --- drivers/net/pse-pd/tps23881.c | 1 + 1 file changed, 1 insertion(+)