netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] openvswitch: Use kmem_cache_free() instead of kfree()
@ 2014-01-08 10:13 Wei Yongjun
       [not found] ` <CAPgLHd_jaxf4jsvUzBhE_RFioHgZzvmWhA=d_J5phUOhBGy49g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2014-01-08 10:13 UTC (permalink / raw)
  To: jesse, pshelar, davem; +Cc: yongjun_wei, dev, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

memory allocated by kmem_cache_alloc() should be freed using
kmem_cache_free(), not kfree().

Fixes: e298e5057006 ('openvswitch: Per cpu flow stats.')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 net/openvswitch/flow_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
index b430d42..c58a0fe 100644
--- a/net/openvswitch/flow_table.c
+++ b/net/openvswitch/flow_table.c
@@ -104,7 +104,7 @@ struct sw_flow *ovs_flow_alloc(bool percpu_stats)
 	}
 	return flow;
 err:
-	kfree(flow);
+	kmem_cache_free(flow_cache, flow);
 	return ERR_PTR(-ENOMEM);
 }
 

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

* Re: [PATCH -next] openvswitch: Use kmem_cache_free() instead of kfree()
       [not found] ` <CAPgLHd_jaxf4jsvUzBhE_RFioHgZzvmWhA=d_J5phUOhBGy49g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-01-08 14:17   ` Jesse Gross
  2014-01-09 19:27     ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Jesse Gross @ 2014-01-08 14:17 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, netdev, David Miller,
	Wei Yongjun

On Wed, Jan 8, 2014 at 5:13 AM, Wei Yongjun <weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
>
> memory allocated by kmem_cache_alloc() should be freed using
> kmem_cache_free(), not kfree().
>
> Fixes: e298e5057006 ('openvswitch: Per cpu flow stats.')
> Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>

Good catch, thanks.

I'll let David pick this up directly since I just flushed my patch queue.

Acked-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>

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

* Re: [PATCH -next] openvswitch: Use kmem_cache_free() instead of kfree()
  2014-01-08 14:17   ` Jesse Gross
@ 2014-01-09 19:27     ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2014-01-09 19:27 UTC (permalink / raw)
  To: jesse; +Cc: weiyj.lk, pshelar, yongjun_wei, dev, netdev

From: Jesse Gross <jesse@nicira.com>
Date: Wed, 8 Jan 2014 09:17:11 -0500

> On Wed, Jan 8, 2014 at 5:13 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> memory allocated by kmem_cache_alloc() should be freed using
>> kmem_cache_free(), not kfree().
>>
>> Fixes: e298e5057006 ('openvswitch: Per cpu flow stats.')
>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Good catch, thanks.
> 
> I'll let David pick this up directly since I just flushed my patch queue.
> 
> Acked-by: Jesse Gross <jesse@nicira.com>

Applied, thanks.

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

end of thread, other threads:[~2014-01-09 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 10:13 [PATCH -next] openvswitch: Use kmem_cache_free() instead of kfree() Wei Yongjun
     [not found] ` <CAPgLHd_jaxf4jsvUzBhE_RFioHgZzvmWhA=d_J5phUOhBGy49g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-01-08 14:17   ` Jesse Gross
2014-01-09 19:27     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).