summary refs log tree commit diff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-06-27 08:49:12 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-06-27 08:49:12 -0700
commit3b6ab1012cbcabf31db9c3a0c329d07dbcff4fd7 (patch)
tree4381b5dd05bc03897d32f1e6e4364ae3cb22a6b4 /drivers
parent8530684fd37c151bbcf6c101ea3d0d784e221d98 (diff)
parente05d57dcb8c71492268ff46ba9bfe9a9cfb1f95d (diff)
downloadlinux-3b6ab1012cbcabf31db9c3a0c329d07dbcff4fd7.tar.gz
Merge tag 'riscv-for-linus-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt:
 "This contains a handful of fixes I'd like to target for rc3.

  Most of them fix issues with the conversion of our vDSO to C. There is
  also one fix to the SiFive PRCI driver that I picked up as it's
  causing boot issues on the hardware.

   - A fix to allow kernels with dynamic ftrace to use the vDSO.

   - Some build fixes for the C vDSO functions.

   - A fix to the PRCI driver's memory allocation, which was the cause
     of some boot panics with FREELIST_RANDOM"

* tag 'riscv-for-linus-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  riscv: Fixup __vdso_gettimeofday broke dynamic ftrace
  riscv: Add extern declarations for vDSO time-related functions
  clk: sifive: allocate sufficient memory for struct __prci_data
  riscv: Add -fPIC option to CFLAGS_vgettimeofday.o
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/sifive/fu540-prci.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c
index 6282ee2f361c..a8901f90a61a 100644
--- a/drivers/clk/sifive/fu540-prci.c
+++ b/drivers/clk/sifive/fu540-prci.c
@@ -586,7 +586,10 @@ static int sifive_fu540_prci_probe(struct platform_device *pdev)
 	struct __prci_data *pd;
 	int r;
 
-	pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
+	pd = devm_kzalloc(dev,
+			  struct_size(pd, hw_clks.hws,
+				      ARRAY_SIZE(__prci_init_clocks)),
+			  GFP_KERNEL);
 	if (!pd)
 		return -ENOMEM;