mirror of
https://gitee.com/open-loongarch/linux-6.12.git
synced 2026-10-28 22:17:11 +08: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: d2d10ede04b1 ("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>
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
committed by
maoxiaochuan
parent
4f26a03386
commit
9a8c051fc8
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user