dmaengine: at_hdmac: fix potential NULL pointer dereference in atc_prep_dma_interleaved
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Mon, 20 Nov 2017 14:28:14 +0000 (08:28 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:05:48 +0000 (11:05 +0100)
commit3250df9fa82bb8c25af7acfd5875d684b9995119
tree0046b218a800ebffc75d96f02e6f7cefdecc26db
parentb3df69b4abe6cfd8efc8c3c187cff7f02aeff642
dmaengine: at_hdmac: fix potential NULL pointer dereference in atc_prep_dma_interleaved

[ Upstream commit 62a277d43d47e74972de44d33bd3763e31992414 ]

_xt_ is being dereferenced before it is null checked, hence there is a
potential null pointer dereference.

Fix this by moving the pointer dereference after _xt_ has been null
checked.

This issue was detected with the help of Coccinelle.

Fixes: 4483320e241c ("dmaengine: Use Pointer xt after NULL check.")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/at_hdmac.c