of: property: decrement node refcount in of_fwnode_get_reference_args()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 21 Nov 2022 02:32:09 +0000 (10:32 +0800)
committerRob Herring <robh@kernel.org>
Tue, 22 Nov 2022 23:22:52 +0000 (17:22 -0600)
commit60d865bd5a9b15a3961eb1c08bd4155682a3c81e
treefc9dc1f7352df4fabc60adbd93f1cd219031c26a
parent917c362b5f8a6e31ff35719b1bacfc1b76a1fd2f
of: property: decrement node refcount in of_fwnode_get_reference_args()

In of_fwnode_get_reference_args(), the refcount of of_args.np has
been incremented in the case of successful return from
of_parse_phandle_with_args() or of_parse_phandle_with_fixed_args().

Decrement the refcount if of_args is not returned to the caller of
of_fwnode_get_reference_args().

Fixes: 3e3119d3088f ("device property: Introduce fwnode_property_get_reference_args")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Link: https://lore.kernel.org/r/20221121023209.3909759-1-yangyingliang@huawei.com
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/property.c