* [PATCH next] spi: spi-qpic-snand: use kmalloc() for OOB buffer allocation
@ 2025-03-20 18:11 Gabor Juhos
2025-04-07 16:15 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Gabor Juhos @ 2025-03-20 18:11 UTC (permalink / raw)
To: Mark Brown
Cc: Md Sadre Alam, Sricharan Ramabadhran, Varadarajan Narayanan,
linux-spi, linux-arm-msm, linux-mtd, linux-kernel, Gabor Juhos
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: Gabor Juhos <j4g8y7@gmail.com>
---
drivers/spi/spi-qpic-snand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c
index fbba7741a9bf336deed1c07eab8d5a94204878d7..b60f5c3fd1db84e66f9263404a52251460a4afec 100644
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -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);
---
base-commit: ad4488845193e81549c11903a5083b4c9cc19785
change-id: 20250320-qpic-snand-kmalloc-3f6c1fb6c873
Best regards,
--
Gabor Juhos <j4g8y7@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH next] spi: spi-qpic-snand: use kmalloc() for OOB buffer allocation
2025-03-20 18:11 [PATCH next] spi: spi-qpic-snand: use kmalloc() for OOB buffer allocation Gabor Juhos
@ 2025-04-07 16:15 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-04-07 16:15 UTC (permalink / raw)
To: Gabor Juhos
Cc: Md Sadre Alam, Sricharan Ramabadhran, Varadarajan Narayanan,
linux-spi, linux-arm-msm, linux-mtd, linux-kernel
On Thu, 20 Mar 2025 19:11:59 +0100, Gabor Juhos wrote:
> 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.
>
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: spi-qpic-snand: use kmalloc() for OOB buffer allocation
commit: f48d80503504257682e493dc17408f2f0b47bcfa
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-07 16:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-20 18:11 [PATCH next] spi: spi-qpic-snand: use kmalloc() for OOB buffer allocation Gabor Juhos
2025-04-07 16:15 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®