* [PATCH v2] net: dsa: felix: Fix memory leak in felix_setup_mmio_filtering
@ 2021-12-09 11:05 José Expósito
2021-12-09 16:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: José Expósito @ 2021-12-09 11:05 UTC (permalink / raw)
To: vladimir.oltean
Cc: claudiu.manoil, alexandre.belloni, andrew, vivien.didelot,
f.fainelli, davem, kuba, linux, netdev, linux-kernel,
José Expósito
Avoid a memory leak if there is not a CPU port defined.
Fixes: 8d5f7954b7c8 ("net: dsa: felix: break at first CPU port during init and teardown")
Addresses-Coverity-ID: 1492897 ("Resource leak")
Addresses-Coverity-ID: 1492899 ("Resource leak")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
v2: Add Fixes and Reviewed-by tags
---
drivers/net/dsa/ocelot/felix.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 327cc4654806..f1a05e7dc818 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -290,8 +290,11 @@ static int felix_setup_mmio_filtering(struct felix *felix)
}
}
- if (cpu < 0)
+ if (cpu < 0) {
+ kfree(tagging_rule);
+ kfree(redirect_rule);
return -EINVAL;
+ }
tagging_rule->key_type = OCELOT_VCAP_KEY_ETYPE;
*(__be16 *)tagging_rule->key.etype.etype.value = htons(ETH_P_1588);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] net: dsa: felix: Fix memory leak in felix_setup_mmio_filtering
2021-12-09 11:05 [PATCH v2] net: dsa: felix: Fix memory leak in felix_setup_mmio_filtering José Expósito
@ 2021-12-09 16:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-09 16:20 UTC (permalink / raw)
To: =?utf-8?b?Sm9zw6kgRXhww7NzaXRvIDxqb3NlLmV4cG9zaXRvODlAZ21haWwuY29tPg==?=
Cc: vladimir.oltean, claudiu.manoil, alexandre.belloni, andrew,
vivien.didelot, f.fainelli, davem, kuba, linux, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 9 Dec 2021 12:05:40 +0100 you wrote:
> Avoid a memory leak if there is not a CPU port defined.
>
> Fixes: 8d5f7954b7c8 ("net: dsa: felix: break at first CPU port during init and teardown")
> Addresses-Coverity-ID: 1492897 ("Resource leak")
> Addresses-Coverity-ID: 1492899 ("Resource leak")
> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> [...]
Here is the summary with links:
- [v2] net: dsa: felix: Fix memory leak in felix_setup_mmio_filtering
https://git.kernel.org/netdev/net/c/e8b1d7698038
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-09 16:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-09 11:05 [PATCH v2] net: dsa: felix: Fix memory leak in felix_setup_mmio_filtering José Expósito
2021-12-09 16:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox