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); } /**