mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
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: 3148d0e5b1 ("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>
This commit is contained in:
parent
e4185bed73
commit
9225f02ff2
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user