mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
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.
Fixes: 764f1b7481 ("spi: add driver for MTK SPI NAND Flash Interface")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260510-snfi-v1-1-bc375cf1af8e@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
5e121a8166
commit
496ba79b94
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user