kernel_samsung_a53x/drivers/clk
Alessandro Carminati 0d6a46a9a3 clk: Sanitize possible_parent_show to Handle Return Value of of_clk_get_parent_name
commit ceb87a361d0b079ecbc7d2831618c19087f304a9 upstream.

In the possible_parent_show function, ensure proper handling of the return
value from of_clk_get_parent_name to prevent potential issues arising from
a NULL return.
The current implementation invokes seq_puts directly on the result of
of_clk_get_parent_name without verifying the return value, which can lead
to kernel panic if the function returns NULL.

This patch addresses the concern by introducing a check on the return
value of of_clk_get_parent_name. If the return value is not NULL, the
function proceeds to call seq_puts, providing the returned value as
argument.
However, if of_clk_get_parent_name returns NULL, the function provides a
static string as argument, avoiding the panic.

Fixes: 1ccc0ddf046a ("clk: Use seq_puts() in possible_parent_show()")
Reported-by: Philip Daly <pdaly@redhat.com>
Signed-off-by: Alessandro Carminati (Red Hat) <alessandro.carminati@gmail.com>
Link: https://lore.kernel.org/r/20230921073217.572151-1-alessandro.carminati@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-18 10:58:31 +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 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imgtec Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imx Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ingenic Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
keystone Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
loongson1 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mediatek Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
meson Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
microchip Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03: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 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
renesas Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rockchip Import A536BXXU9EXDC 2024-06-15 16:02:09 -03: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 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03: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 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk-asm9260.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03: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 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03: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 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03: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 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03: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 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03: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: Sanitize possible_parent_show to Handle Return Value of of_clk_get_parent_name 2024-11-18 10:58:31 +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