staging: mt7621-dma: fix potentially dereferencing uninitialized 'tx_desc'
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Sat, 20 Oct 2018 11:31:06 +0000 (13:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Dec 2018 18:32:12 +0000 (19:32 +0100)
commitbea52e4d1e4278b5852ef20149883536ab5c4d02
treec25b89d3d715b190a528e4ab89569cdb71c8f24f
parent6df2b837939a9fba3375c9dd8c5e6e841e0086e2
staging: mt7621-dma: fix potentially dereferencing uninitialized 'tx_desc'

commit 354e379684fcc70ab8d5450b4d57bd92b5294dfd upstream.

Function 'mtk_hsdma_start_transfer' uses 'tx_desc' pointer which can be
dereferenced before it is initializated. Initializate pointer before
avoiding the problem.

Fixes: 0853c7a53eb3 ("staging: mt7621-dma: ralink: add rt2880 dma engine")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-dma/mtk-hsdma.c