spi: mtk-snfi: Fix resource leak in mtk_snand_read_page_cache()
Subsystems (2)
PATCH 1/1 spi: mtk-snfi: Fix resource leak in mtk_snand_read_page_cache()
When DMA read times out in mtk_snand_read_page_cache(), the original code erroneously jumped to cleanup label which skips DMA unmapping and ECC disable, causing a resource leak.
--- drivers/spi/spi-mtk-snfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-mtk-snfi.c +1 -1
@@ -961,7 +961,7 @@ static int mtk_snand_read_page_cache(struct mtk_snand *snf, &snf->op_done, usecs_to_jiffies(SNFI_POLL_INTERVAL))) {dev_err (snf->dev,"DMA timed out for reading from cache.\n" ); ret = -ETIMEDOUT ; - goto cleanup; + goto cleanup2; }// Wait for BUS_SEC_CNTR returning expected value
---
base-commit: e98d21c170b01ddef366f023bbfcf6b31509fa83
change-id: 20260509-snfi-c8d170513987
Best regards,
Signature · 1 line
Felix Gu <[email protected]>
Mark Brown
maintainerQuoted 1 line · Felix Gu
spi: mtk-snfi: Fix resource leak in
mtk_snand_read_page_cache()
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.1
Thanks!
[1/1] spi: mtk-snfi: Fix resource leak in mtk_snand_read_page_cache()
https://git.kernel.org/broonie/spi/c/496ba79b9496
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