linux/arch/mips/alchemy/common
Erick Archer 5b7236c198 MIPS: Alchemy: Use kcalloc() instead of kzalloc()
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.

Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [1]
Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Erick Archer <erick.archer@gmx.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2024-02-20 13:36:34 +01:00
..
clock.c MIPS: Alchemy: Use kcalloc() instead of kzalloc() 2024-02-20 13:36:34 +01:00
dbdma.c MIPS: Alchemy: fix dbdma2 2023-05-23 11:00:02 +02:00
dma.c MIPS: Audit and remove any unnecessary uses of module.h 2017-02-14 09:00:25 +00:00
gpiolib.c mips: alchemy: gpio: Include the right header 2022-11-11 15:45:37 +01:00
irq.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
platform.c serial: 8250: RT288x/Au1xxx code away from core 2023-05-13 19:47:26 +09:00
power.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
prom.c MIPS: Alchemy: Fix missing prototypes 2024-01-22 10:32:36 +01:00
setup.c MIPS: Alchemy: Fix missing prototypes 2024-01-22 10:32:36 +01:00
sleeper.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
time.c MIPS: Replace setup_irq() by request_irq() 2020-03-05 16:47:35 +01:00
usb.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
vss.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00