All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] net: sched: em_text: fix possible memory leak in em_text_destroy()
@ 2023-12-21  2:25 Hangyu Hua
  2023-12-21 17:29 ` Simon Horman
  2024-01-01 13:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Hangyu Hua @ 2023-12-21  2:25 UTC (permalink / raw)
  To: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, tgraf
  Cc: netdev, linux-kernel, Hangyu Hua

m->data needs to be freed when em_text_destroy is called.

Fixes: d675c989ed2d ("[PKT_SCHED]: Packet classification based on textsearch (ematch)")
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
---
	
	v2: fix a type usage error

 net/sched/em_text.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/sched/em_text.c b/net/sched/em_text.c
index 6f3c1fb2fb44..f176afb70559 100644
--- a/net/sched/em_text.c
+++ b/net/sched/em_text.c
@@ -97,8 +97,10 @@ static int em_text_change(struct net *net, void *data, int len,
 
 static void em_text_destroy(struct tcf_ematch *m)
 {
-	if (EM_TEXT_PRIV(m) && EM_TEXT_PRIV(m)->config)
+	if (EM_TEXT_PRIV(m) && EM_TEXT_PRIV(m)->config) {
 		textsearch_destroy(EM_TEXT_PRIV(m)->config);
+		kfree(EM_TEXT_PRIV(m));
+	}
 }
 
 static int em_text_dump(struct sk_buff *skb, struct tcf_ematch *m)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] net: sched: em_text: fix possible memory leak in em_text_destroy()
  2023-12-21  2:25 [PATCH v2] net: sched: em_text: fix possible memory leak in em_text_destroy() Hangyu Hua
@ 2023-12-21 17:29 ` Simon Horman
  2024-01-01 13:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-12-21 17:29 UTC (permalink / raw)
  To: Hangyu Hua
  Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, tgraf,
	netdev, linux-kernel

On Thu, Dec 21, 2023 at 10:25:31AM +0800, Hangyu Hua wrote:
> m->data needs to be freed when em_text_destroy is called.
> 
> Fixes: d675c989ed2d ("[PKT_SCHED]: Packet classification based on textsearch (ematch)")
> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] net: sched: em_text: fix possible memory leak in em_text_destroy()
  2023-12-21  2:25 [PATCH v2] net: sched: em_text: fix possible memory leak in em_text_destroy() Hangyu Hua
  2023-12-21 17:29 ` Simon Horman
@ 2024-01-01 13:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-01-01 13:10 UTC (permalink / raw)
  To: Hangyu Hua
  Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, tgraf,
	netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 21 Dec 2023 10:25:31 +0800 you wrote:
> m->data needs to be freed when em_text_destroy is called.
> 
> Fixes: d675c989ed2d ("[PKT_SCHED]: Packet classification based on textsearch (ematch)")
> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
> ---
> 
> [...]

Here is the summary with links:
  - [v2] net: sched: em_text: fix possible memory leak in em_text_destroy()
    https://git.kernel.org/netdev/net/c/8fcb0382af6f

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] 3+ messages in thread

end of thread, other threads:[~2024-01-01 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-21  2:25 [PATCH v2] net: sched: em_text: fix possible memory leak in em_text_destroy() Hangyu Hua
2023-12-21 17:29 ` Simon Horman
2024-01-01 13:10 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.