2019-09-28 14:32:04

by Wen Yang

[permalink] [raw]
Subject: [PATCH] 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")
Signed-off-by: Wen Yang <[email protected]>
Cc: Wolfgang Grandegger <[email protected]>
Cc: Marc Kleine-Budde <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Franklin S Cooper Jr <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
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


2019-10-04 21:13:41

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH] can: dev: add missing of_node_put after calling of_get_child_by_name

On 9/28/19 4:29 PM, Wen Yang wrote:
> 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 <[email protected]>
> Cc: Wolfgang Grandegger <[email protected]>
> Cc: Marc Kleine-Budde <[email protected]>
> Cc: "David S. Miller" <[email protected]>
> Cc: Franklin S Cooper Jr <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]

Applied to linux-can.

Tnx,
Marc

--
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 |


Attachments:
signature.asc (499.00 B)
OpenPGP digital signature