[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210124073955.728797-1-christophe.jaillet@wanadoo.fr>
Date: Sun, 24 Jan 2021 08:39:55 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
vadivel.muruganx.ramuthevar@...ux.intel.com,
martin.blumenstingl@...glemail.com
Cc: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] mtd: rawnand: Fix an error handling path in 'ebu_dma_start()'
If 'dmaengine_prep_slave_single()' fails, we must undo a previous
'dma_map_single()' call, as already done in all the other error handling
paths of this function.
Fixes: 0b1039f016e8 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC")
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
drivers/mtd/nand/raw/intel-nand-controller.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/raw/intel-nand-controller.c b/drivers/mtd/nand/raw/intel-nand-controller.c
index a304fda5d1fa..8b49fd56cf96 100644
--- a/drivers/mtd/nand/raw/intel-nand-controller.c
+++ b/drivers/mtd/nand/raw/intel-nand-controller.c
@@ -318,8 +318,10 @@ static int ebu_dma_start(struct ebu_nand_controller *ebu_host, u32 dir,
}
tx = dmaengine_prep_slave_single(chan, buf_dma, len, dir, flags);
- if (!tx)
- return -ENXIO;
+ if (!tx) {
+ ret = -ENXIO;
+ goto err_unmap;
+ }
tx->callback = callback;
tx->callback_param = ebu_host;
--
2.27.0
Powered by blists - more mailing lists