Peter Griffin cc17862516 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>
(cherry picked from commit 5d16d3dc28a95915c1f7a41f68f2a069ced4b578)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
2024-04-16 10:30:33 +00:00
..
2016-11-29 08:21:33 +00:00
2023-11-20 10:27:34 +01:00
2017-07-18 08:27:18 +01:00
2017-09-04 14:49:04 +01:00
2016-08-10 09:25:18 +01:00
2017-04-27 09:25:04 +01:00