2021-06-17 05:10:24

by Yang Yingliang

[permalink] [raw]
Subject: [PATCH net-next] net: ipa: Add missing of_node_put() in ipa_firmware_load()

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 <[email protected]>
Signed-off-by: Yang Yingliang <[email protected]>
---
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);
--
2.25.1


2021-06-17 10:26:23

by Alex Elder

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

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 <[email protected]>
> Signed-off-by: Yang Yingliang <[email protected]>

Acked-by: Alex Elder <[email protected]>

> ---
> 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);
>

2021-06-17 23:50:24

by patchwork-bot+netdevbpf

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

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Thu, 17 Jun 2021 13:11:19 +0800 you 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 <[email protected]>
> Signed-off-by: Yang Yingliang <[email protected]>
>
> [...]

Here is the summary with links:
- [net-next] net: ipa: Add missing of_node_put() in ipa_firmware_load()
https://git.kernel.org/netdev/net-next/c/b244163f2c45

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html