Commit a35551c7 authored by Charlie Jenkins's avatar Charlie Jenkins Committed by Palmer Dabbelt

riscv: Fix relocation_hashtable size

A second dereference is needed to get the accurate size of the
relocation_hashtable.
Signed-off-by: default avatarCharlie Jenkins <charlie@rivosinc.com>
Fixes: d8792a57 ("riscv: Safely remove entries from relocation list")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarJulia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/r/202312120044.wTI1Uyaa-lkp@intel.com/Reviewed-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20240104-module_loading_fix-v3-3-a71f8de6ce0f@rivosinc.comSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 4b38b36b
......@@ -764,7 +764,7 @@ initialize_relocation_hashtable(unsigned int num_relocations,
hashtable_size <<= should_double_size;
*relocation_hashtable = kmalloc_array(hashtable_size,
sizeof(*relocation_hashtable),
sizeof(**relocation_hashtable),
GFP_KERNEL);
if (!*relocation_hashtable)
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment