mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] workqueue: use kmem_cache_free() instead of kfree()
@ 2013-04-09  6:29 Wei Yongjun
  2013-04-09 18:35 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-04-09  6:29 UTC (permalink / raw)
  To: tj; +Cc: yongjun_wei, linux-kernel

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

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

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index c273376..154aa12 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3750,7 +3750,7 @@ static void free_unbound_pwq(struct pool_workqueue *pwq)
 
 	if (pwq) {
 		put_unbound_pool(pwq->pool);
-		kfree(pwq);
+		kmem_cache_free(pwq_cache, pwq);
 	}
 }
 


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

* Re: [PATCH -next] workqueue: use kmem_cache_free() instead of kfree()
  2013-04-09  6:29 [PATCH -next] workqueue: use kmem_cache_free() instead of kfree() Wei Yongjun
@ 2013-04-09 18:35 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2013-04-09 18:35 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: yongjun_wei, linux-kernel

On Tue, Apr 09, 2013 at 02:29:11PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> memory allocated by kmem_cache_alloc() should be freed using
> kmem_cache_free(), not kfree().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Oops, thanks for fixing it.  Applied to wq/for-3.10.

Thanks!

-- 
tejun

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

end of thread, other threads:[~2013-04-09 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-09  6:29 [PATCH -next] workqueue: use kmem_cache_free() instead of kfree() Wei Yongjun
2013-04-09 18:35 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®