Unverified Commit f48d8050 authored by Gabor Juhos's avatar Gabor Juhos Committed by Mark Brown
Browse files

spi: spi-qpic-snand: use kmalloc() for OOB buffer allocation



The qcom_spi_ecc_init_ctx_pipelined() function allocates zeroed
memory for the OOB buffer, then it fills the buffer with '0xff'
bytes right after the allocation. In this case zeroing the memory
during allocation is superfluous, so use kmalloc() instead of
kzalloc() to avoid that.

Signed-off-by: default avatarGabor Juhos <j4g8y7@gmail.com>
Link: https://patch.msgid.link/20250320-qpic-snand-kmalloc-v1-1-94e267550675@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1f1d979f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ static int qcom_spi_ecc_init_ctx_pipelined(struct nand_device *nand)
	ecc_cfg = kzalloc(sizeof(*ecc_cfg), GFP_KERNEL);
	if (!ecc_cfg)
		return -ENOMEM;
	snandc->qspi->oob_buf = kzalloc(mtd->writesize + mtd->oobsize,
	snandc->qspi->oob_buf = kmalloc(mtd->writesize + mtd->oobsize,
					GFP_KERNEL);
	if (!snandc->qspi->oob_buf) {
		kfree(ecc_cfg);