public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] mtd: nand: realtek-ecc: Fix a IS_ERR() vs NULL bug in probe
@ 2025-10-03  9:30 Dan Carpenter
  2025-10-03 14:28 ` AW: " markus.stockhausen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2025-10-03  9:30 UTC (permalink / raw)
  To: Markus Stockhausen
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, linux-mtd,
	linux-kernel, kernel-janitors

The dma_alloc_noncoherent() function doesn't return error pointers, it
returns NULL on error.  Fix the error checking to match.

Fixes: 3148d0e5b1c5 ("mtd: nand: realtek-ecc: Add Realtek external ECC engine support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/mtd/nand/ecc-realtek.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/ecc-realtek.c b/drivers/mtd/nand/ecc-realtek.c
index 7d718934c909..7c275f1eb4a7 100644
--- a/drivers/mtd/nand/ecc-realtek.c
+++ b/drivers/mtd/nand/ecc-realtek.c
@@ -418,8 +418,8 @@ static int rtl_ecc_probe(struct platform_device *pdev)
 
 	rtlc->buf = dma_alloc_noncoherent(dev, RTL_ECC_DMA_SIZE, &rtlc->buf_dma,
 					  DMA_BIDIRECTIONAL, GFP_KERNEL);
-	if (IS_ERR(rtlc->buf))
-		return PTR_ERR(rtlc->buf);
+	if (!rtlc->buf)
+		return -ENOMEM;
 
 	rtlc->dev = dev;
 	rtlc->engine.dev = dev;
-- 
2.51.0


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

* AW: [PATCH next] mtd: nand: realtek-ecc: Fix a IS_ERR() vs NULL bug in probe
  2025-10-03  9:30 [PATCH next] mtd: nand: realtek-ecc: Fix a IS_ERR() vs NULL bug in probe Dan Carpenter
@ 2025-10-03 14:28 ` markus.stockhausen
  2025-10-08  9:38 ` Geert Uytterhoeven
  2025-10-22  9:56 ` Miquel Raynal
  2 siblings, 0 replies; 4+ messages in thread
From: markus.stockhausen @ 2025-10-03 14:28 UTC (permalink / raw)
  To: 'Dan Carpenter'
  Cc: 'Miquel Raynal', 'Richard Weinberger',
	'Vignesh Raghavendra', linux-mtd, linux-kernel,
	kernel-janitors

> Von: Dan Carpenter <dan.carpenter@linaro.org> 
> Gesendet: Freitag, 3. Oktober 2025 11:30
>
> The dma_alloc_noncoherent() function doesn't return error pointers, it
> returns NULL on error.  Fix the error checking to match.

Hi Dan,

thanks for the quick fix.

Markus


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

* Re: [PATCH next] mtd: nand: realtek-ecc: Fix a IS_ERR() vs NULL bug in probe
  2025-10-03  9:30 [PATCH next] mtd: nand: realtek-ecc: Fix a IS_ERR() vs NULL bug in probe Dan Carpenter
  2025-10-03 14:28 ` AW: " markus.stockhausen
@ 2025-10-08  9:38 ` Geert Uytterhoeven
  2025-10-22  9:56 ` Miquel Raynal
  2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2025-10-08  9:38 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Markus Stockhausen, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel, kernel-janitors

On Fri, 3 Oct 2025 at 11:30, Dan Carpenter <dan.carpenter@linaro.org> wrote:
> The dma_alloc_noncoherent() function doesn't return error pointers, it
> returns NULL on error.  Fix the error checking to match.
>
> Fixes: 3148d0e5b1c5 ("mtd: nand: realtek-ecc: Add Realtek external ECC engine support")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH next] mtd: nand: realtek-ecc: Fix a IS_ERR() vs NULL bug in probe
  2025-10-03  9:30 [PATCH next] mtd: nand: realtek-ecc: Fix a IS_ERR() vs NULL bug in probe Dan Carpenter
  2025-10-03 14:28 ` AW: " markus.stockhausen
  2025-10-08  9:38 ` Geert Uytterhoeven
@ 2025-10-22  9:56 ` Miquel Raynal
  2 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2025-10-22  9:56 UTC (permalink / raw)
  To: Markus Stockhausen, Dan Carpenter
  Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel,
	kernel-janitors

On Fri, 03 Oct 2025 12:30:10 +0300, Dan Carpenter wrote:
> The dma_alloc_noncoherent() function doesn't return error pointers, it
> returns NULL on error.  Fix the error checking to match.
> 
> 

Applied to mtd/fixes, thanks!

[1/1] mtd: nand: realtek-ecc: Fix a IS_ERR() vs NULL bug in probe
      commit: 9225f02ff201837e1443076f37a3c008140d1835

Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).

Kind regards,
Miquèl


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

end of thread, other threads:[~2025-10-22  9:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-03  9:30 [PATCH next] mtd: nand: realtek-ecc: Fix a IS_ERR() vs NULL bug in probe Dan Carpenter
2025-10-03 14:28 ` AW: " markus.stockhausen
2025-10-08  9:38 ` Geert Uytterhoeven
2025-10-22  9:56 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox