]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mtd: rawnand: use kcalloc() instead of kzalloc()
authorEthan Carter Edwards <ethan@ethancedwards.com>
Sat, 22 Feb 2025 19:19:43 +0000 (14:19 -0500)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 24 Feb 2025 15:38:36 +0000 (16:38 +0100)
commit34684bb5e43609ba8ac1a54c4e585493c5486cab
tree982e686d3ed619d51d8e12e243ec07c48af3fbc7
parent1db50b96b059ca8e5548cb3e0e38a888b325f96b
mtd: rawnand: use kcalloc() instead of kzalloc()

We are trying to get rid of all multiplications from allocation
functions to prevent integer overflows[1]. Here the multiplication is
obviously safe, but using kcalloc() is more appropriate and improves
readability. This patch has no effect on runtime behavior.

Link: https://github.com/KSPP/linux/issues/162
Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/nand_base.c