Peter Griffin 5d16d3dc28 mfd: syscon: Call of_node_put() only when of_parse_phandle() takes a ref
[ Upstream commit d2b0680cf3b05490b579e71b0df6e07451977745 ]

of_parse_phandle() returns a device_node with refcount incremented, which
the callee needs to call of_node_put() on when done. We should only call
of_node_put() when the property argument is provided though as otherwise
nothing has taken a reference on the node.

Fixes: 45330bb43421 ("mfd: syscon: Allow property as NULL in syscon_regmap_lookup_by_phandle")
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20240220115012.471689-2-peter.griffin@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:22:40 -04:00
..
2016-11-29 08:21:33 +00:00
2018-06-11 07:20:17 -07:00
2018-07-04 07:17:13 +01:00
2023-11-20 10:29:19 +01:00
2018-01-08 11:03:35 +00:00
2017-07-18 08:27:18 +01:00
2016-08-10 09:25:18 +01:00
2017-04-27 09:25:04 +01:00