aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@rivosinc.com>2025-04-10 10:04:53 -0700
committerPalmer Dabbelt <palmer@rivosinc.com>2025-04-10 10:04:53 -0700
commitd6890adc70a0cc84b6296c090b80be3f2dbfcb8e (patch)
tree2689e4a3f1038ab8d379d10aa2e7446a4b403ddc
parentLinux 6.15-rc1 (diff)
parentDocumentation: riscv: Fix typo MIMPLID -> MIMPID (diff)
downloadwireguard-linux-d6890adc70a0cc84b6296c090b80be3f2dbfcb8e.tar.xz
wireguard-linux-d6890adc70a0cc84b6296c090b80be3f2dbfcb8e.zip
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
-rw-r--r--Documentation/arch/riscv/hwprobe.rst2
-rw-r--r--arch/riscv/kernel/module.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst
index 53607d962653..f60bf5991755 100644
--- a/Documentation/arch/riscv/hwprobe.rst
+++ b/Documentation/arch/riscv/hwprobe.rst
@@ -51,7 +51,7 @@ The following keys are defined:
* :c:macro:`RISCV_HWPROBE_KEY_MARCHID`: Contains the value of ``marchid``, as
defined by the RISC-V privileged architecture specification.
-* :c:macro:`RISCV_HWPROBE_KEY_MIMPLID`: Contains the value of ``mimplid``, as
+* :c:macro:`RISCV_HWPROBE_KEY_MIMPID`: Contains the value of ``mimpid``, as
defined by the RISC-V privileged architecture specification.
* :c:macro:`RISCV_HWPROBE_KEY_BASE_BEHAVIOR`: A bitmask containing the base
diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c
index 47d0ebeec93c..0ae34d79b87b 100644
--- a/arch/riscv/kernel/module.c
+++ b/arch/riscv/kernel/module.c
@@ -648,7 +648,7 @@ process_accumulated_relocations(struct module *me,
kfree(bucket_iter);
}
- kfree(*relocation_hashtable);
+ kvfree(*relocation_hashtable);
}
static int add_relocation_to_accumulate(struct module *me, int type,
@@ -752,9 +752,10 @@ initialize_relocation_hashtable(unsigned int num_relocations,
hashtable_size <<= should_double_size;
- *relocation_hashtable = kmalloc_array(hashtable_size,
- sizeof(**relocation_hashtable),
- GFP_KERNEL);
+ /* Number of relocations may be large, so kvmalloc it */
+ *relocation_hashtable = kvmalloc_array(hashtable_size,
+ sizeof(**relocation_hashtable),
+ GFP_KERNEL);
if (!*relocation_hashtable)
return 0;