* [PATCH] spi: ep93xx: fix double-free of zeropage on DMA setup failure
@ 2026-05-29 15:31 Felix Gu
2026-06-08 18:03 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-05-29 15:31 UTC (permalink / raw)
To: Mark Brown, H Hartley Sweeten, Grant Likely, Vinod Koul, Mika Westerberg
Cc: linux-spi, linux-kernel, Felix Gu
If DMA setup fails after allocating the zeropage, the error path frees
the page but leaves espi->zeropage dangling. A subsequent call to
ep93xx_spi_release_dma() sees the non-NULL pointer and frees the page
again.
Clear the pointer after freeing in the error path of
ep93xx_spi_setup_dma().
Fixes: 626a96db1169 ("spi/ep93xx: add DMA support")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/spi/spi-ep93xx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index ea610b0537a9..bf389d7590d3 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -600,6 +600,7 @@ static int ep93xx_spi_setup_dma(struct device *dev, struct ep93xx_spi *espi)
espi->dma_rx = NULL;
fail_free_page:
free_page((unsigned long)espi->zeropage);
+ espi->zeropage = NULL;
return ret;
}
---
base-commit: f7af91adc230aa99e23330ecf85bc9badd9780ad
change-id: 20260529-ep93xx-8ac307cb5434
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: ep93xx: fix double-free of zeropage on DMA setup failure
2026-05-29 15:31 [PATCH] spi: ep93xx: fix double-free of zeropage on DMA setup failure Felix Gu
@ 2026-06-08 18:03 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-06-08 18:03 UTC (permalink / raw)
To: H Hartley Sweeten, Grant Likely, Vinod Koul, Mika Westerberg, Felix Gu
Cc: linux-spi, linux-kernel
On Fri, 29 May 2026 23:31:06 +0800, Felix Gu wrote:
> spi: ep93xx: fix double-free of zeropage on DMA setup failure
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.2
Thanks!
[1/1] spi: ep93xx: fix double-free of zeropage on DMA setup failure
https://git.kernel.org/broonie/spi/c/7886054b06f7
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:[~2026-06-09 8:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-29 15:31 [PATCH] spi: ep93xx: fix double-free of zeropage on DMA setup failure Felix Gu
2026-06-08 18:03 ` 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®