linux/drivers/clk/sifive
Vincent Chen 0935afc397 clk: sifive: allocate sufficient memory for struct __prci_data
[ Upstream commit d0a5fdf4cc ]

The (struct __prci_data).hw_clks.hws is an array with dynamic elements.
Using struct_size(pd, hw_clks.hws, ARRAY_SIZE(__prci_init_clocks))
instead of sizeof(*pd) to get the correct memory size of
struct __prci_data for sifive/fu540-prci. After applying this
modifications, the kernel runs smoothly with CONFIG_SLAB_FREELIST_RANDOM
enabled on the HiFive unleashed board.

Fixes: 30b8e27e3b ("clk: sifive: add a driver for the SiFive FU540 PRCI IP block")
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-30 15:37:01 -04:00
..
fu540-prci.c clk: sifive: allocate sufficient memory for struct __prci_data 2020-06-30 15:37:01 -04:00
Kconfig clk: sifive: restrict Kconfig scope for the FU540 PRCI driver 2019-05-21 11:34:45 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00