Skip to content

Commit a35551c

Browse files
charlie-rivospalmer-dabbelt
authored andcommitted
riscv: Fix relocation_hashtable size
A second dereference is needed to get the accurate size of the relocation_hashtable. Signed-off-by: Charlie Jenkins <charlie@rivosinc.com> Fixes: d8792a5 ("riscv: Safely remove entries from relocation list") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Julia Lawall <julia.lawall@inria.fr> Closes: https://lore.kernel.org/r/202312120044.wTI1Uyaa-lkp@intel.com/ Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20240104-module_loading_fix-v3-3-a71f8de6ce0f@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 4b38b36 commit a35551c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/riscv/kernel/module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ initialize_relocation_hashtable(unsigned int num_relocations,
764764
hashtable_size <<= should_double_size;
765765

766766
*relocation_hashtable = kmalloc_array(hashtable_size,
767-
sizeof(*relocation_hashtable),
767+
sizeof(**relocation_hashtable),
768768
GFP_KERNEL);
769769
if (!*relocation_hashtable)
770770
return 0;

0 commit comments

Comments
 (0)