linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: fsmc: Fix error code in fsmc_nand_probe()
@ 2021-02-15 15:58 Dan Carpenter
  2021-03-02 16:32 ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-02-15 15:58 UTC (permalink / raw)
  To: Miquel Raynal, Vipin Kumar
  Cc: Richard Weinberger, Vignesh Raghavendra, Boris Brezillon,
	Tony Luck, Fenghua Yu, linux-mtd, linux-kernel, kernel-janitors

If dma_request_channel() fails then the probe fails and it should
return a negative error code, but currently it returns success.

fixes: 4774fb0a48aa ("mtd: nand/fsmc: Add DMA support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/mtd/nand/raw/fsmc_nand.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
index 0101c0fab50a..a24e2f57fa68 100644
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ b/drivers/mtd/nand/raw/fsmc_nand.c
@@ -1077,11 +1077,13 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 		host->read_dma_chan = dma_request_channel(mask, filter, NULL);
 		if (!host->read_dma_chan) {
 			dev_err(&pdev->dev, "Unable to get read dma channel\n");
+			ret = -ENODEV;
 			goto disable_clk;
 		}
 		host->write_dma_chan = dma_request_channel(mask, filter, NULL);
 		if (!host->write_dma_chan) {
 			dev_err(&pdev->dev, "Unable to get write dma channel\n");
+			ret = -ENODEV;
 			goto release_dma_read_chan;
 		}
 	}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: rawnand: fsmc: Fix error code in fsmc_nand_probe()
  2021-02-15 15:58 [PATCH] mtd: rawnand: fsmc: Fix error code in fsmc_nand_probe() Dan Carpenter
@ 2021-03-02 16:32 ` Miquel Raynal
  0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2021-03-02 16:32 UTC (permalink / raw)
  To: Dan Carpenter, Miquel Raynal, Vipin Kumar
  Cc: Fenghua Yu, Tony Luck, Vignesh Raghavendra, Richard Weinberger,
	kernel-janitors, linux-kernel, Boris Brezillon, linux-mtd

On Mon, 2021-02-15 at 15:58:49 UTC, Dan Carpenter wrote:
> If dma_request_channel() fails then the probe fails and it should
> return a negative error code, but currently it returns success.
> 
> fixes: 4774fb0a48aa ("mtd: nand/fsmc: Add DMA support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-02 20:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 15:58 [PATCH] mtd: rawnand: fsmc: Fix error code in fsmc_nand_probe() Dan Carpenter
2021-03-02 16:32 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).