linux-stable/drivers/clk
Len Baker 37004db2a5 clk: ti: composite: Prefer kcalloc over open coded arithmetic
As noted in the "Deprecated Interfaces, Language Features, Attributes,
and Conventions" documentation [1], size calculations (especially
multiplication) should not be performed in memory allocator (or similar)
function arguments due to the risk of them overflowing. This could lead
to values wrapping around and a smaller allocation being made than the
caller was expecting. Using those allocations could lead to linear
overflows of heap memory and other misbehaviors.

So, use the purpose specific kcalloc() function instead of the argument
size * count in the kzalloc() function.

[1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210904131714.2312-1-len.baker@gmx.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2022-05-20 20:40:07 -07:00
..
actions clk: actions: Make sentinel elements more obvious 2022-03-11 18:13:24 -08:00
analogbits Merge branch 'akpm' (patches from Andrew) 2021-07-02 12:08:10 -07:00
at91 Merge branches 'clk-starfive', 'clk-ti', 'clk-terminate' and 'clk-cleanup' into clk-next 2022-03-29 10:19:10 -07:00
axis clk: cleanup comments 2022-03-11 18:22:15 -08:00
axs10x
baikal-t1
bcm Merge branches 'clk-range', 'clk-uniphier', 'clk-apple' and 'clk-qcom' into clk-next 2022-03-29 10:19:36 -07:00
berlin
davinci
h8300
hisilicon Merge branches 'clk-starfive', 'clk-ti', 'clk-terminate' and 'clk-cleanup' into clk-next 2022-03-29 10:19:10 -07:00
imgtec
imx clk: imx: Select MXC_CLK for i.MX93 clock driver 2022-03-15 14:44:46 -07:00
ingenic clk: jz4725b: fix mmc0 clock gating 2022-02-17 17:05:07 -08:00
keystone clk: keystone: syscon-clk: Add support for AM62 epwm-tbclk 2022-04-22 19:04:47 -07:00
loongson1 clk: loongson1: Terminate clk_div_table with sentinel element 2022-03-11 18:13:24 -08:00
mediatek clk: mediatek: Warn if clk IDs are duplicated 2022-02-17 12:12:25 -08:00
meson clk: cleanup comments 2022-03-11 18:22:15 -08:00
microchip clk: microchip: Add driver for Microchip PolarFire SoC 2022-03-11 19:31:52 -08:00
mmp Merge branches 'clk-starfive', 'clk-ti', 'clk-terminate' and 'clk-cleanup' into clk-next 2022-03-29 10:19:10 -07:00
mstar
mvebu clk: mvebu: use time_is_before_eq_jiffies() instead of open coding it 2022-02-17 14:06:12 -08:00
mxs
nxp clk: nxp: Declare mux table parameter as const u32 * 2022-02-25 16:41:39 -08:00
pistachio clk: pistachio: Declare mux table as const u32[] 2022-02-25 16:41:39 -08:00
pxa
qcom There's one large change in the core clk framework here. We change how 2022-03-30 10:11:04 -07:00
ralink clk: ralink: make system controller node a reset provider 2022-02-15 17:06:37 +01:00
renesas clk: renesas: r8a779f0: Add PFC clock 2022-02-22 09:51:20 +01:00
rockchip clk: rockchip: re-add rational best approximation algorithm to the fractional divider 2022-02-24 00:07:16 +01:00
samsung clk: samsung: fix missing Tesla FSD dependency on Exynos 2022-02-01 09:14:53 +01:00
sifive clk: sifive: Move all stuff into SoCs header files from C files 2022-03-15 15:56:28 -07:00
socfpga clk: cleanup comments 2022-03-11 18:22:15 -08:00
spear
sprd
st clk: st: clkgen-mux: search reg within node or parent 2022-01-05 17:21:28 -08:00
starfive clk: starfive: Add JH7100 audio clock driver 2022-03-10 18:17:33 -08:00
sunxi clk: sunxi: sun8i-apb0: Make use of the helper function devm_platform_ioremap_resource() 2021-09-13 09:03:24 +02:00
sunxi-ng clk: sunxi-ng: sun6i-rtc: include clk/sunxi-ng.h 2022-03-25 11:36:29 +01:00
tegra clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver 2022-03-11 19:22:18 -08:00
ti clk: ti: composite: Prefer kcalloc over open coded arithmetic 2022-05-20 20:40:07 -07:00
uniphier clk: uniphier: Fix fixed-rate initialization 2022-03-11 19:29:02 -08:00
ux500 clk: ux500: Add driver for the reset portions of PRCC 2021-10-26 18:06:05 -07:00
versatile clk: versatile: clk-icst: use after free on error path 2021-12-07 12:25:29 -08:00
visconti clk: visconti: prevent array overflow in visconti_clk_register_gates() 2022-03-17 12:21:28 -07:00
x86 clk: x86: Fix clk_gate_flags for RV_CLK_GATE 2022-01-06 17:57:53 -08:00
xilinx
zynq clk: zynq: Update the parameters to zynq_clk_register_periph_clk 2022-03-29 10:17:49 -07:00
zynqmp clk: zynqmp: replace warn_once with pr_debug for failed clock ops 2022-01-24 17:18:23 -08:00
.kunitconfig clk: Introduce Kunit Tests for the framework 2022-03-11 19:14:38 -08:00
clk-apple-nco.c clk: clk-apple-nco: Allow and fix module building 2022-03-15 09:56:12 -07:00
clk-asm9260.c
clk-aspeed.c
clk-aspeed.h
clk-ast2600.c clk/ast2600: Fix soc revision for AHB 2021-11-03 19:42:35 -07:00
clk-axi-clkgen.c
clk-axm5516.c
clk-bd718x7.c
clk-bm1880.c clk: bm1880: remove kfrees on static allocations 2022-01-06 17:46:56 -08:00
clk-bulk.c
clk-cdce706.c
clk-cdce925.c
clk-clps711x.c clk: clps711x: Terminate clk_div_table with sentinel element 2022-03-11 18:13:24 -08:00
clk-composite.c clk: composite: Fix 'switching' to same clock 2021-11-03 17:49:54 -07:00
clk-conf.c
clk-cs2000-cp.c clk: cs2000-cp: convert driver to regmap 2022-01-25 14:23:16 -08:00
clk-devres.c clk: fix leak on devm_clk_bulk_get_all() unwind 2021-07-31 00:53:38 -07:00
clk-divider.c clk: divider: Implement and wire up .determine_rate by default 2021-08-05 17:35:58 -07:00
clk-fixed-factor.c clk: fixed-factor: Introduce devm_clk_hw_register_fixed_factor_index() 2022-03-18 14:04:54 -07:00
clk-fixed-mmio.c
clk-fixed-rate.c
clk-fractional-divider.c clk: cleanup comments 2022-03-11 18:22:15 -08:00
clk-fractional-divider.h clk: fractional-divider: Hide clk_fractional_divider_ops from wide audience 2021-08-12 12:42:00 -07:00
clk-fsl-flexspi.c
clk-fsl-sai.c
clk-gate.c clk: gate: Add devm_clk_hw_register_gate() 2021-12-08 11:19:20 +01:00
clk-gate_test.c clk: gate: Add some kunit test suites 2022-01-24 17:22:53 -08:00
clk-gemini.c clk: Gemini: fix struct name in kernel-doc 2021-12-02 17:27:48 -08:00
clk-gpio.c
clk-hi655x.c
clk-highbank.c
clk-hsdk-pll.c
clk-k210.c
clk-lan966x.c clk: lan966x: Extend lan966x clock driver for clock gating support 2021-12-08 11:19:20 +01:00
clk-lmk04832.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
clk-lochnagar.c
clk-max9485.c
clk-max77686.c
clk-milbeaut.c
clk-moxart.c
clk-multiplier.c
clk-mux.c clk: mux: Declare u32 *table parameter as const 2022-02-25 16:41:39 -08:00
clk-nomadik.c
clk-npcm7xx.c
clk-nspire.c
clk-oxnas.c clk: Use of_device_get_match_data() 2022-03-11 19:23:30 -08:00
clk-palmas.c clk: palmas: Add a missing SPDX license header 2021-08-05 17:34:30 -07:00
clk-plldig.c
clk-pwm.c
clk-qoriq.c
clk-renesas-pcie.c clk: rs9: Add Renesas 9-series PCIe clock generator driver 2022-03-18 14:09:27 -07:00
clk-rk808.c
clk-s2mps11.c
clk-scmi.c clk: scmi: Support atomic clock enable/disable API 2022-02-21 10:37:00 +00:00
clk-scpi.c
clk-si514.c
clk-si544.c
clk-si570.c
clk-si5341.c Merge branches 'clk-starfive', 'clk-ti', 'clk-terminate' and 'clk-cleanup' into clk-next 2022-03-29 10:19:10 -07:00
clk-si5351.c clk: si5351: Update datasheet references 2021-11-02 14:29:17 -07:00
clk-si5351.h clk: si5351: Update datasheet references 2021-11-02 14:29:17 -07:00
clk-sparx5.c
clk-stm32f4.c clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after system enter shell 2021-12-15 22:45:48 -08:00
clk-stm32h7.c clk: stm32h7: Switch to clk_divider.determine_rate 2021-08-05 17:36:10 -07:00
clk-stm32mp1.c clk: stm32mp1: Add parent_data to ETHRX clock 2022-01-24 17:17:31 -08:00
clk-tps68470.c clk: Introduce clk-tps68470 driver 2021-12-15 20:12:07 -08:00
clk-twl6040.c
clk-versaclock5.c clk: vc5: Use i2c .probe_new 2021-11-02 14:28:51 -07:00
clk-vt8500.c
clk-wm831x.c
clk-xgene.c
clk.c Revert "clk: Drop the rate range on clk_put()" 2022-04-02 19:28:53 -07:00
clk.h
clk_test.c Revert "clk: Drop the rate range on clk_put()" 2022-04-02 19:28:53 -07:00
clkdev.c
Kconfig There's one large change in the core clk framework here. We change how 2022-03-30 10:11:04 -07:00
Makefile Merge branches 'clk-range', 'clk-uniphier', 'clk-apple' and 'clk-qcom' into clk-next 2022-03-29 10:19:36 -07:00