]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:23:02 +0000 (11:23 +0100)
commit1f21cfdaece2d6a25a1859e23fc37bff53b5be11
treeb970a93e0021cc7fb9245c8f602f4c3c7dd00f52
parentc757522cc8902c93ae1fe142bc4d23d545c3b231
of: property: decrement node refcount in of_fwnode_get_reference_args()

[ Upstream commit 47b50197aad282e17e2d69f45c822b58e8dfcaae ]

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: 6c03b8e1b1ee ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/of/property.c