2013-04-09 06:29:13

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next] workqueue: use kmem_cache_free() instead of kfree()

From: Wei Yongjun <[email protected]>

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

Signed-off-by: Wei Yongjun <[email protected]>
---
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);
}
}


2013-04-09 18:35:15

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH -next] workqueue: use kmem_cache_free() instead of kfree()

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

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

Thanks!

--
tejun