1
0
Fork 0
alistair23-linux/drivers/clk/bcm
Nathan Chancellor 4d33659ac3 clk: bcm2835: Fix return type of bcm2835_register_gate
[ Upstream commit f376c43bec ]

bcm2835_register_gate is used as a callback for the clk_register member
of bcm2835_clk_desc, which expects a struct clk_hw * return type but
bcm2835_register_gate returns a struct clk *.

This discrepancy is hidden by the fact that bcm2835_register_gate is
cast to the typedef bcm2835_clk_register by the _REGISTER macro. This
turns out to be a control flow integrity violation, which is how this
was noticed.

Change the return type of bcm2835_register_gate to be struct clk_hw *
and use clk_hw_register_gate to do so. This should be a non-functional
change as clk_register_gate calls clk_hw_register_gate anyways but this
is needed to avoid issues with further changes.

Fixes: b19f009d45 ("clk: bcm2835: Migrate to clk_hw based registration and OF APIs")
Link: https://github.com/ClangBuiltLinux/linux/issues/1028
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lkml.kernel.org/r/20200516080806.1459784-1-natechancellor@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-24 17:50:34 +02:00
..
Kconfig This round of clk driver and framework updates is heavy on the driver update 2019-07-17 10:07:48 -07:00
Makefile Merge branches 'clk-bcm63xx', 'clk-silabs', 'clk-lochnagar' and 'clk-rockchip' into clk-next 2019-07-12 11:11:51 -07:00
clk-bcm63xx-gate.c clk: fix devm_platform_ioremap_resource.cocci warnings 2019-09-06 10:30:22 -07:00
clk-bcm63xx.c clk: bcm: Add BCM63138 clock support 2015-11-20 15:46:27 -08:00
clk-bcm281xx.c clk: bcm281xx: move compatible string definitions 2014-04-30 11:51:39 -07:00
clk-bcm2835-aux.c clk: Remove io.h from clk-provider.h 2019-05-15 13:21:37 -07:00
clk-bcm2835.c clk: bcm2835: Fix return type of bcm2835_register_gate 2020-06-24 17:50:34 +02:00
clk-bcm21664.c clk: bcm21664: use common clock framework 2014-04-30 11:51:44 -07:00
clk-bcm53573-ilp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
clk-cygnus.c clk: iproc: Allow iproc pll to runtime calculate vco parameters 2017-12-28 14:53:33 -08:00
clk-hr2.c clk: bcm: Add Broadcom Hurricane 2 clock support 2017-10-12 11:31:46 -07:00
clk-iproc-armpll.c clk: bcm: iproc: Migrate to clk_hw based registration and OF APIs 2016-06-30 12:26:45 -07:00
clk-iproc-asiu.c treewide: Use struct_size() for kmalloc()-family 2018-06-06 11:15:43 -07:00
clk-iproc-pll.c treewide: Use struct_size() for kmalloc()-family 2018-06-06 11:15:43 -07:00
clk-iproc.h clk: iproc: Allow iproc pll to runtime calculate vco parameters 2017-12-28 14:53:33 -08:00
clk-kona-setup.c clk: Convert to using %pOFn instead of device_node.name 2018-08-30 09:50:20 -07:00
clk-kona.c clk: Remove io.h from clk-provider.h 2019-05-15 13:21:37 -07:00
clk-kona.h clk: bcm: kona: Migrate to clk_hw based registration and OF APIs 2016-08-24 16:06:18 -07:00
clk-ns2.c clk: ns2: Correct SDIO bits 2017-04-19 09:50:39 -07:00
clk-nsp.c clk: iproc: Split off dig_filter 2015-10-21 17:02:57 -07:00
clk-raspberrypi.c clk: raspberrypi: register platform device for raspberrypi-cpufreq 2019-06-25 16:04:28 -07:00
clk-sr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 459 2019-06-19 17:09:09 +02:00