mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
mtd: rawnand: loongson1: Fix error code in ls1x_nand_dma_transfer()
The "desc" variable is NULL and PTR_ERR(NULL) is zero/success. Return
a negative error code instead.
Fixes: d2d10ede04 ("mtd: rawnand: Add Loongson-1 NAND Controller Driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
parent
e6031b1154
commit
0d470c72be
|
|
@ -371,7 +371,7 @@ static int ls1x_nand_dma_transfer(struct ls1x_nand_host *host, struct ls1x_nand_
|
|||
desc = dmaengine_prep_slave_single(chan, dma_addr, op->len, xfer_dir, DMA_PREP_INTERRUPT);
|
||||
if (!desc) {
|
||||
dev_err(dev, "failed to prepare DMA descriptor\n");
|
||||
ret = PTR_ERR(desc);
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
desc->callback = ls1x_nand_dma_callback;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user