Skip to content

Commit 9225f02

Browse files
Dan Carpentermiquelraynal
authored andcommitted
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: 3148d0e ("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>
1 parent e4185be commit 9225f02

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/mtd/nand/ecc-realtek.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ static int rtl_ecc_probe(struct platform_device *pdev)
418418

419419
rtlc->buf = dma_alloc_noncoherent(dev, RTL_ECC_DMA_SIZE, &rtlc->buf_dma,
420420
DMA_BIDIRECTIONAL, GFP_KERNEL);
421-
if (IS_ERR(rtlc->buf))
422-
return PTR_ERR(rtlc->buf);
421+
if (!rtlc->buf)
422+
return -ENOMEM;
423423

424424
rtlc->dev = dev;
425425
rtlc->engine.dev = dev;

0 commit comments

Comments
 (0)