Skip to contentSkip to conversation

can: dev: add missing of_node_put after calling of_get_child_by_name

PATCH Applied Wen Yang 2 participants 2 messages Sep 28, 2019 – Oct 4, 2019

Subsystems (3)
lore
Share & tools
lore

Wen Yang

author
#0 lore raw

PATCH 1/1 can: dev: add missing of_node_put after calling of_get_child_by_name

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")
Cc Wolfgang Grandegger <[email protected]>
Cc Marc Kleine-Budde <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Franklin S Cooper Jr <[email protected]>
---
 drivers/net/can/dev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/can/dev.c +1 -0
index ac86be5..1c88c36 100644
@@ -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");
 }
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 12 lines · Wen Yang

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")
Cc Wolfgang Grandegger <[email protected]>
Cc Marc Kleine-Budde <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Franklin S Cooper Jr <[email protected]>

Applied to linux-can.

Tnx,
Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |