[PATCH 7/8] mtd: rawnand: qcom: Early structure initialization

Miquel Raynal miquel.raynal at bootlin.com
Fri Jul 28 05:34:32 PDT 2023


On Sun, 2023-07-16 at 14:46:11 UTC, Miquel Raynal wrote:
> Instead of allocating a structure on the stack with random data and then
> expect the callee to perform the initialization (which is, in general,
> error prone), prefer zeroing the structure explicitly at allocation and
> provide the already zeroed area, so no explicit memset operation is
> needed. It is probably safer to do so, so we limit the timeframe when
> dirty data could actually be accessed by mistake.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
> Acked-by: Manivannan Sadhasivam <mani at kernel.org>
> Reviewed-by: Tudor Ambarus <tudor.ambarus at linaro.org>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel



More information about the linux-arm-kernel mailing list