* [PATCH -next] RDMA/srpt: Use kmem_cache_free() instead of kfree()
@ 2018-12-22 10:30 Wei Yongjun
2018-12-22 23:09 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2018-12-22 10:30 UTC (permalink / raw)
To: target-devel
memory allocated by kmem_cache_alloc() should be freed using
kmem_cache_free(), not kfree().
Fixes: 5dabcd0456d7 ("RDMA/srpt: Add support for immediate data")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index d38205c..e9c336c 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -674,7 +674,7 @@ static struct srpt_ioctx *srpt_alloc_ioctx(struct srpt_device *sdev,
return ioctx;
err_free_buf:
- kfree(ioctx->buf);
+ kmem_cache_free(buf_cache, ioctx->buf);
err_free_ioctx:
kfree(ioctx);
err:
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] RDMA/srpt: Use kmem_cache_free() instead of kfree()
2018-12-22 10:30 [PATCH -next] RDMA/srpt: Use kmem_cache_free() instead of kfree() Wei Yongjun
@ 2018-12-22 23:09 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2018-12-22 23:09 UTC (permalink / raw)
To: target-devel
On Sat, Dec 22, 2018 at 10:30:30AM +0000, Wei Yongjun wrote:
> memory allocated by kmem_cache_alloc() should be freed using
> kmem_cache_free(), not kfree().
>
> Fixes: 5dabcd0456d7 ("RDMA/srpt: Add support for immediate data")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-next
Thanks,
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-22 23:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-22 10:30 [PATCH -next] RDMA/srpt: Use kmem_cache_free() instead of kfree() Wei Yongjun
2018-12-22 23:09 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox