linux-stable/drivers/clk
Colin Ian King 8200597fb1 clk: vc5: fix use of memory after it has been kfree'd
There are a several places where printing an error message of
init.name occurs after init.name has been kfree'd. Also the failure
message is duplicated each time in the code. Fix this by adding
a registration error failure path for these cases, moving the
duplicated error messages to one common point and kfree'ing init.name
only after it has been used.

Changes also shrink the object code size by 171 bytes (x86-64, gcc 9.3):

Before:
   text	   data	    bss	    dec	    hex	filename
  21057	   3960	     64	  25081	   61f9	drivers/clk/clk-versaclock5.o

After:
   text	   data	    bss	    dec	    hex	filename
  20886	   3960	     64	  24910	   614e	drivers/clk/clk-versaclock5.o

Addresses-Coverity: ("Use after free")
Fixes: f491276a51 ("clk: vc5: Allow Versaclock driver to support multiple instances")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200625132736.88832-1-colin.king@canonical.com
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
[sboyd@kernel.org: Drop stray newline]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2020-07-22 18:46:24 -07:00
..
actions Merge branches 'clk-cdce-regulator', 'clk-bcm', 'clk-evict-parent-cache' and 'clk-actions' into clk-next 2019-09-19 15:31:46 -07:00
analogbits
at91 clk: at91: allow setting all PMC clock parents via DT 2020-05-26 20:22:50 -07:00
axis
axs10x clk: axs10x: use devm_platform_ioremap_resource() to simplify code 2019-10-16 16:17:50 -07:00
baikal-t1 clk: baikal-t1: remove redundant assignment to variable 'divider' 2020-06-09 13:45:37 -07:00
bcm clk: bcm2835: Constify struct debugfs_reg32 2020-05-27 00:08:31 -07:00
berlin
davinci clk: davinci: use devm_platform_ioremap_resource() to simplify code 2019-10-16 16:17:14 -07:00
h8300
hisilicon Merge branches 'clk-hisi', 'clk-amlogic', 'clk-samsung', 'clk-renesas' and 'clk-imx' into clk-next 2019-11-27 08:14:17 -08:00
imgtec treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
imx clk: imx: use imx8m_clk_hw_composite_bus for i.MX8M bus clk slice 2020-05-21 22:37:48 +08:00
ingenic clk: ingenic: Mark ingenic_tcu_of_match as __maybe_unused 2020-05-28 16:47:02 -07:00
keystone treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
loongson1
mediatek treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
meson clk: meson: meson8b: Don't rely on u-boot to init all GP_PLL registers 2020-05-02 01:53:32 +02:00
microchip clk: let init callback return an error code 2019-12-23 18:53:13 -08:00
mmp This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00
mvebu clk: Fix Kconfig indentation 2020-01-04 23:34:39 -08:00
mxs
nxp
pistachio
pxa clk: pxa: fix one of the pxa RTC clocks 2019-11-13 15:01:17 -08:00
qcom This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00
renesas clk: renesas: cpg-mssr: Fix STBCR suspend/resume handling 2020-05-18 11:06:33 +02:00
rockchip clk: rockchip: fix incorrect configuration of rk3228 aclk_gpu* clocks 2020-04-13 09:35:24 +02:00
samsung clk: samsung: exynos5433: Add IGNORE_UNUSED flag to sclk_i2s1 2020-05-19 16:58:42 +02:00
sifive
sirf clk: sirf: Don't reference clk_init_data after registration 2019-08-16 10:20:07 -07:00
socfpga clk: socfpga: agilex: add clock driver for the Agilex platform 2020-05-26 19:13:05 -07:00
spear clk: spear: Make structure i2s_sclk_masks constant 2019-09-06 10:27:40 -07:00
sprd This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00
st clk: clk-flexgen: fix clock-critical handling 2020-05-27 01:14:06 -07:00
sunxi clk: sunxi: Fix incorrect usage of round_down() 2020-04-14 09:21:05 +02:00
sunxi-ng clk: sunxi-ng: sun8i-de2: Sort structures 2020-02-12 19:01:16 +01:00
tegra This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00
ti treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
uniphier clk: uniphier: Add SCSSI clock gate for each channel 2020-01-04 23:14:22 -08:00
ux500 clk: ux500: Fix up the SGA clock for some variants 2020-01-04 23:27:15 -08:00
versatile treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
x86 clk: intel: remove redundant initialization of variable rate64 2020-05-28 16:00:33 -07:00
zte clk: zx296718: Don't reference clk_init_data after registration 2019-08-16 10:20:15 -07:00
zynq
zynqmp This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00
clk-asm9260.c clk: asm9260: fix __clk_hw_register_fixed_rate_with_accuracy typo 2020-04-13 12:20:06 -07:00
clk-aspeed.c clk: aspeed: Add RMII RCLK gates for both AST2500 MACs 2019-11-26 10:02:48 -08:00
clk-aspeed.h clk: aspeed: Move structures to header 2019-09-06 15:17:02 -07:00
clk-ast2600.c clk: ast2600: Fix AHB clock divider for A1 2020-05-27 01:36:22 -07:00
clk-axi-clkgen.c
clk-axm5516.c
clk-bd718x7.c clk: bd718x7: Support ROHM BD71828 clk block 2020-01-24 07:22:47 +00:00
clk-bm1880.c clk: bm1800: Remove set but not used variable 'fref' 2019-12-24 00:10:33 -08:00
clk-bulk.c clk: Make clk_bulk_get_all() return a valid "id" 2019-09-17 13:26:31 -07:00
clk-cdce706.c
clk-cdce925.c clk: clk-cdce925: Add regulator support 2019-09-06 10:31:16 -07:00
clk-clps711x.c
clk-composite.c clk: composite: add _register_composite_pdata() variants 2020-01-28 13:26:48 -08:00
clk-conf.c
clk-cs2000-cp.c
clk-devres.c
clk-divider.c clk: divider: Add support for specifying parents via DT/pointers 2020-01-07 23:08:02 -08:00
clk-efm32gg.c
clk-fixed-factor.c
clk-fixed-mmio.c
clk-fixed-rate.c clk: fixed-rate: Add clk flags for parent accuracy 2020-01-06 23:07:34 -08:00
clk-fractional-divider.c
clk-fsl-sai.c clk: fsl-sai: new driver 2020-01-28 13:26:48 -08:00
clk-gate.c clk: gate: Add support for specifying parents via DT/pointers 2020-01-06 23:10:12 -08:00
clk-gemini.c
clk-gpio.c clk: gpio: Use DT way of specifying parents 2020-01-05 13:34:36 -08:00
clk-hi655x.c
clk-highbank.c
clk-hsdk-pll.c CLK: HSDK: CGU: add support for 148.5MHz clock 2020-05-28 21:06:39 -07:00
clk-lochnagar.c clk: lochnagar: Don't reference clk_init_data after registration 2019-08-16 10:20:07 -07:00
clk-max9485.c
clk-max77686.c
clk-milbeaut.c clk: milbeaut: Don't reference clk_init_data after registration 2019-08-16 10:20:15 -07:00
clk-moxart.c
clk-multiplier.c
clk-mux.c clk: mux: Add support for specifying parents via DT/pointers 2020-01-06 23:10:05 -08:00
clk-nomadik.c
clk-npcm7xx.c
clk-nspire.c
clk-oxnas.c
clk-palmas.c
clk-plldig.c clk: ls1028a: fix a dereference of pointer 'parent' before a null check 2020-02-03 23:03:49 -08:00
clk-pwm.c
clk-qoriq.c clk: qoriq: add cpufreq platform device 2020-05-07 10:47:27 +05:30
clk-rk808.c
clk-s2mps11.c
clk-scmi.c clk: scmi: Match scmi device by both name and protocol id 2019-12-24 11:36:46 +00:00
clk-scpi.c
clk-si514.c
clk-si544.c
clk-si570.c
clk-si5341.c clk: clk-si5341: Add support for the Si5345 series 2020-05-28 21:00:51 -07:00
clk-si5351.c
clk-si5351.h
clk-stm32f4.c
clk-stm32h7.c
clk-stm32mp1.c
clk-tango4.c
clk-twl6040.c
clk-u300.c
clk-versaclock5.c clk: vc5: fix use of memory after it has been kfree'd 2020-07-22 18:46:24 -07:00
clk-vt8500.c
clk-wm831x.c
clk-xgene.c
clk.c This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00
clk.h
clkdev.c
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00