spi: rockchip: potential NULL dereference on error
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 4 May 2016 06:25:46 +0000 (09:25 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 4 May 2016 13:41:56 +0000 (14:41 +0100)
commit5de7ed0c980c4bcfd8ea5c0b84a61b76df7d6c08
tree338afa10016cc76221713c59e58625d3d6444279
parent3d277b177918cd26215732fc23af0783ab4b37dd
spi: rockchip: potential NULL dereference on error

We were calling dma_release_channel(rs->dma_tx.ch) when "rs->dma_tx.ch"
is potentially NULL.  There is actually a call to that in the unwind
code at the bottom of the function so we can just re-arrange this a bit
and remove the call.  Also there is no need to set rs->dma_tx.ch to
NULL on this error path.

Fixes: e4c0e06f949b ('spi: rockchip: fix probe deferral handling')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-rockchip.c