mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 05:01:27 +00:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user