Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mtd: nand: realtek-ecc: Fix a IS_ERR() vs NULL bug in probe

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>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Dan Carpenter and committed by
Miquel Raynal
9225f02f e4185bed

+2 -2
+2 -2
drivers/mtd/nand/ecc-realtek.c
··· 418 418 419 419 rtlc->buf = dma_alloc_noncoherent(dev, RTL_ECC_DMA_SIZE, &rtlc->buf_dma, 420 420 DMA_BIDIRECTIONAL, GFP_KERNEL); 421 - if (IS_ERR(rtlc->buf)) 422 - return PTR_ERR(rtlc->buf); 421 + if (!rtlc->buf) 422 + return -ENOMEM; 423 423 424 424 rtlc->dev = dev; 425 425 rtlc->engine.dev = dev;