kernel_samsung_a53x/drivers/clk
Bryan O'Donoghue fe89d6f02d clk: Fix clk_core_get NULL dereference
[ Upstream commit e97fe4901e0f59a0bfd524578fe3768f8ca42428 ]

It is possible for clk_core_get to dereference a NULL in the following
sequence:

clk_core_get()
    of_clk_get_hw_from_clkspec()
        __of_clk_get_hw_from_provider()
            __clk_get_hw()

__clk_get_hw() can return NULL which is dereferenced by clk_core_get() at
hw->core.

Prior to commit dde4eff47c82 ("clk: Look for parents with clkdev based
clk_lookups") the check IS_ERR_OR_NULL() was performed which would have
caught the NULL.

Reading the description of this function it talks about returning NULL but
that cannot be so at the moment.

Update the function to check for hw before dereferencing it and return NULL
if hw is NULL.

Fixes: dde4eff47c82 ("clk: Look for parents with clkdev based clk_lookups")
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Link: https://lore.kernel.org/r/20240302-linux-next-24-03-01-simple-clock-fixes-v1-1-25f348a5982b@linaro.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 08:44:56 +01:00
..
actions Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
analogbits Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
at91 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
axis Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
axs10x Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
baikal-t1 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
berlin Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
davinci Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
h8300 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hisilicon clk: hisilicon: hi3519: Release the correct number of gates in hi3519_clk_unregister() 2024-11-19 08:44:54 +01:00
imgtec Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imx clk: imx: imx8mq: correct error handling path 2024-11-18 11:42:53 +01:00
ingenic Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
keystone clk: keystone: pll: fix a couple NULL vs IS_ERR() checks 2024-11-18 11:42:53 +01:00
loongson1 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mediatek clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data 2024-11-18 11:42:54 +01:00
meson Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
microchip Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmp clk: mmp: pxa168: Fix memory leak in pxa168_clk_init() 2024-11-18 12:13:18 +01:00
mvebu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mxs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nxp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pistachio Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qcom clk: qcom: dispcc-sdm845: Adjust internal GDSC wait times 2024-11-19 08:44:54 +01:00
renesas Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rockchip clk: rockchip: rk3128: Fix HCLK_OTG gate register 2024-11-18 12:12:16 +01:00
samsung Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sifive Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sirf Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socfpga Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
spear Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sprd Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
st Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sunxi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sunxi-ng Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tegra Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti clk: ti: fix double free in of_ti_divider_clk_setup() 2024-11-18 11:42:54 +01:00
uniphier Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ux500 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
versatile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
x86 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
zte Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
zynq Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
zynqmp drivers: clk: zynqmp: update divider round rate logic 2024-11-18 12:12:42 +01:00
clk-asm9260.c clk: asm9260: use parent index to link the reference clock 2024-11-18 11:42:53 +01:00
clk-aspeed.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-aspeed.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-ast2600.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-axi-clkgen.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-axm5516.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-bd718x7.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-bm1880.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-bulk.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-cdce706.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-cdce925.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-clps711x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-composite.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-conf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-cs2000-cp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-devres.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-divider.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-efm32gg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-fixed-factor.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-fixed-mmio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-fixed-rate.c clk: fixed-rate: add devm_clk_hw_register_fixed_rate 2024-11-18 12:12:43 +01:00
clk-fractional-divider.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-fsl-sai.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-gate.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-gemini.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-gpio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-hi655x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-highbank.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-hsdk-pll.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-lochnagar.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-max9485.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-max77686.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-milbeaut.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-moxart.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-multiplier.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-mux.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-nomadik.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-npcm7xx.c clk: npcm7xx: Fix incorrect kfree 2024-11-18 11:42:54 +01:00
clk-nspire.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-oxnas.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-palmas.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-plldig.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-pwm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-qoriq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-rk808.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-s2mps11.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-scmi.c clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped 2024-11-18 11:43:02 +01:00
clk-scpi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-si514.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-si544.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-si570.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-si5341.c clk: si5341: fix an error code problem in si5341_output_clk_set_rate 2024-11-18 12:12:42 +01:00
clk-si5351.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-si5351.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-sparx5.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-stm32f4.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-stm32h7.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-stm32mp1.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-tango4.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-twl6040.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-u300.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-versaclock5.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-vt8500.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-wm831x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-xgene.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk.c clk: Fix clk_core_get NULL dereference 2024-11-19 08:44:56 +01:00
clk.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clkdev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00