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 <[email protected]> Fixes: d8792a5 ("riscv: Safely remove entries from relocation list") Reported-by: kernel test robot <[email protected]> Reported-by: Julia Lawall <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Reviewed-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 4b38b36 commit a35551c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)