of_node_put needs to be called when the device node which is got
from of_get_child_by_name finished using.

fixes: 2290aefa2e90 ("can: dev: Add support for limiting configured bitrate")
Signed-off-by: Wen Yang <weny...@linux.alibaba.com>
Cc: Wolfgang Grandegger <w...@grandegger.com>
Cc: Marc Kleine-Budde <m...@pengutronix.de>
Cc: "David S. Miller" <da...@davemloft.net>
Cc: Franklin S Cooper Jr <fcoo...@ti.com>
Cc: linux-...@vger.kernel.org
Cc: net...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/net/can/dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index ac86be5..1c88c36 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -848,6 +848,7 @@ void of_can_transceiver(struct net_device *dev)
                return;
 
        ret = of_property_read_u32(dn, "max-bitrate", &priv->bitrate_max);
+       of_node_put(dn);
        if ((ret && ret != -EINVAL) || (!ret && !priv->bitrate_max))
                netdev_warn(dev, "Invalid value for transceiver max bitrate. 
Ignoring bitrate limit.\n");
 }
-- 
1.8.3.1

Reply via email to