Re: [PATCH net-next] net: ipa: Add missing of_node_put() in ipa_firmware_load()

From: Alex Elder
Date: Thu Jun 17 2021 - 06:17:29 EST


On 6/17/21 12:11 AM, Yang Yingliang wrote:
This node pointer is returned by of_parse_phandle() with refcount
incremented in this function. of_node_put() on it before exiting
this function.

Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>

Acked-by: Alex Elder <elder@xxxxxxxxxx>

---
drivers/net/ipa/ipa_main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c
index 2243e3e5b7ea..f82130db32f6 100644
--- a/drivers/net/ipa/ipa_main.c
+++ b/drivers/net/ipa/ipa_main.c
@@ -530,6 +530,7 @@ static int ipa_firmware_load(struct device *dev)
}
ret = of_address_to_resource(node, 0, &res);
+ of_node_put(node);
if (ret) {
dev_err(dev, "error %d getting \"memory-region\" resource\n",
ret);