Skip to content

Commit d6890ad

Browse files
Merge tag 'riscv-fixes-6.15-rc2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/alexghiti/linux into fixes
riscv fixes for 6.15-rc2 * Correct typos in the documentation * Prevent module insertion failures by using kvmalloc to allocate the relocation hashtable. * tag 'riscv-fixes-6.15-rc2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/alexghiti/linux: Documentation: riscv: Fix typo MIMPLID -> MIMPID riscv: Use kvmalloc_array on relocation_hashtable
2 parents 0af2f6b + 70fc03c commit d6890ad

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Documentation/arch/riscv/hwprobe.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The following keys are defined:
5151
* :c:macro:`RISCV_HWPROBE_KEY_MARCHID`: Contains the value of ``marchid``, as
5252
defined by the RISC-V privileged architecture specification.
5353

54-
* :c:macro:`RISCV_HWPROBE_KEY_MIMPLID`: Contains the value of ``mimplid``, as
54+
* :c:macro:`RISCV_HWPROBE_KEY_MIMPID`: Contains the value of ``mimpid``, as
5555
defined by the RISC-V privileged architecture specification.
5656

5757
* :c:macro:`RISCV_HWPROBE_KEY_BASE_BEHAVIOR`: A bitmask containing the base

arch/riscv/kernel/module.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ process_accumulated_relocations(struct module *me,
648648
kfree(bucket_iter);
649649
}
650650

651-
kfree(*relocation_hashtable);
651+
kvfree(*relocation_hashtable);
652652
}
653653

654654
static int add_relocation_to_accumulate(struct module *me, int type,
@@ -752,9 +752,10 @@ initialize_relocation_hashtable(unsigned int num_relocations,
752752

753753
hashtable_size <<= should_double_size;
754754

755-
*relocation_hashtable = kmalloc_array(hashtable_size,
756-
sizeof(**relocation_hashtable),
757-
GFP_KERNEL);
755+
/* Number of relocations may be large, so kvmalloc it */
756+
*relocation_hashtable = kvmalloc_array(hashtable_size,
757+
sizeof(**relocation_hashtable),
758+
GFP_KERNEL);
758759
if (!*relocation_hashtable)
759760
return 0;
760761

0 commit comments

Comments
 (0)