From 27ab15f57329ae318bd72fc26c42e931177997f8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 19 May 2020 22:14:31 +0000 Subject: [PATCH] ib_srpt: Use kvmalloc() instead of vmalloc() git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8941 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index d9c341220..930729092 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -889,7 +889,7 @@ static struct srpt_ioctx **srpt_alloc_ioctx_ring(struct srpt_device *sdev, WARN_ON(ioctx_size != sizeof(struct srpt_recv_ioctx) && ioctx_size != sizeof(struct srpt_send_ioctx)); - ring = vmalloc(ring_size * sizeof(ring[0])); + ring = kvmalloc_array(ring_size, sizeof(ring[0]), GFP_KERNEL); if (!ring) goto out; for (i = 0; i < ring_size; ++i) { @@ -904,7 +904,7 @@ static struct srpt_ioctx **srpt_alloc_ioctx_ring(struct srpt_device *sdev, err: while (--i >= 0) srpt_free_ioctx(sdev, ring[i], buf_cache, dir); - vfree(ring); + kvfree(ring); ring = NULL; out: return ring; @@ -930,7 +930,7 @@ static void srpt_free_ioctx_ring(struct srpt_ioctx **ioctx_ring, for (i = 0; i < ring_size; ++i) srpt_free_ioctx(sdev, ioctx_ring[i], buf_cache, dir); - vfree(ioctx_ring); + kvfree(ioctx_ring); } /**