Skip to content

Commit a93295a

Browse files
Roger Quadroscomputersforpeace
authored andcommitted
mtd: nand: omap2: Don't call dma_release_channel() if dma_request_chan() failed
dma_request_chan() can fail returning an error pointer. In this case prevent calling dma_release_channel() to prevent a ERR_PTR() dereference. As error path can be called even with no DMA configuration, info->dma can be NULL so don't call dma_release_channel() for that case either. Fixes: de3bfc4: ("mtd: nand: omap2: fix return value check in omap_nand_probe()") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Roger Quadros <[email protected]> Acked-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
1 parent 29b4817 commit a93295a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/nand/omap2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,7 @@ static int omap_nand_probe(struct platform_device *pdev)
21692169
return 0;
21702170

21712171
return_error:
2172-
if (info->dma)
2172+
if (!IS_ERR_OR_NULL(info->dma))
21732173
dma_release_channel(info->dma);
21742174
if (nand_chip->ecc.priv) {
21752175
nand_bch_free(nand_chip->ecc.priv);

0 commit comments

Comments
 (0)