]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: omap2: Don't call dma_release_channel() if dma_request_chan() failed
authorRoger Quadros <rogerq@ti.com>
Mon, 15 Aug 2016 07:47:39 +0000 (10:47 +0300)
committerBrian Norris <computersforpeace@gmail.com>
Mon, 29 Aug 2016 19:54:39 +0000 (12:54 -0700)
commit5a9f46275e8e061cf8468584f1e809dad7425f57
tree1a7e73c36ab3aae28dc4ae967c974f40a72b0046
parentb482605f7939bd4035b2d11a7952dc3da5821c6d
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: 82df971ba76d: ("mtd: nand: omap2: fix return value check in omap_nand_probe()")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/omap2.c