summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2018-01-09 12:19:38 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-09 15:41:57 +0100
commit4c03f554bfed0ed1bbc51492b63da64153b3bbbf (patch)
tree1776460d53c443d9be81a8780352237169e3a2eb
parentdc31f99be6822a16b119a1f145555757c6761b36 (diff)
downloadlinux-stable-4c03f554bfed0ed1bbc51492b63da64153b3bbbf.tar.gz
linux-stable-4c03f554bfed0ed1bbc51492b63da64153b3bbbf.tar.bz2
linux-stable-4c03f554bfed0ed1bbc51492b63da64153b3bbbf.zip
staging: lustre: cfs_percpt_alloc: use kvmalloc(GFP_KERNEL)
this allocation is called from several places, but all are during initialization, so GFP_NOFS is not needed. So use kvmalloc and GFP_KERNEL. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lnet/libcfs/libcfs_mem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c b/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c
index 23734cfb5d44..8e2b4f1db0a1 100644
--- a/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c
+++ b/drivers/staging/lustre/lnet/libcfs/libcfs_mem.c
@@ -54,8 +54,7 @@ cfs_percpt_free(void *vars)
LIBCFS_FREE(arr->va_ptrs[i], arr->va_size);
}
- LIBCFS_FREE(arr, offsetof(struct cfs_var_array,
- va_ptrs[arr->va_count]));
+ kvfree(arr);
}
EXPORT_SYMBOL(cfs_percpt_free);
@@ -79,7 +78,8 @@ cfs_percpt_alloc(struct cfs_cpt_table *cptab, unsigned int size)
count = cfs_cpt_number(cptab);
- LIBCFS_ALLOC(arr, offsetof(struct cfs_var_array, va_ptrs[count]));
+ arr = kvzalloc(offsetof(struct cfs_var_array, va_ptrs[count]),
+ GFP_KERNEL);
if (!arr)
return NULL;