aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv/kernel/module.c')
-rw-r--r--arch/riscv/kernel/module.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c
index 7f6147c18033..1961135689db 100644
--- a/arch/riscv/kernel/module.c
+++ b/arch/riscv/kernel/module.c
@@ -663,7 +663,7 @@ static int add_relocation_to_accumulate(struct module *me, int type,
struct used_bucket *bucket;
unsigned long hash;
- entry = kmalloc(sizeof(*entry), GFP_KERNEL);
+ entry = kmalloc_obj(*entry);
if (!entry)
return -ENOMEM;
@@ -697,7 +697,7 @@ static int add_relocation_to_accumulate(struct module *me, int type,
* relocation_entry.
*/
if (!found) {
- rel_head = kmalloc(sizeof(*rel_head), GFP_KERNEL);
+ rel_head = kmalloc_obj(*rel_head);
if (!rel_head) {
kfree(entry);
@@ -709,7 +709,7 @@ static int add_relocation_to_accumulate(struct module *me, int type,
INIT_HLIST_NODE(&rel_head->node);
if (!current_head->first) {
bucket =
- kmalloc(sizeof(struct used_bucket), GFP_KERNEL);
+ kmalloc_obj(struct used_bucket);
if (!bucket) {
kfree(entry);
@@ -753,9 +753,8 @@ initialize_relocation_hashtable(unsigned int num_relocations,
hashtable_size <<= should_double_size;
/* Number of relocations may be large, so kvmalloc it */
- *relocation_hashtable = kvmalloc_array(hashtable_size,
- sizeof(**relocation_hashtable),
- GFP_KERNEL);
+ *relocation_hashtable = kvmalloc_objs(**relocation_hashtable,
+ hashtable_size);
if (!*relocation_hashtable)
return 0;