spi: dw-mid: avoid potential NULL dereference
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 2 Mar 2015 18:15:58 +0000 (20:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 12:59:43 +0000 (13:59 +0100)
commit218e39d05f324e27347be8f33338651aa7bc7a19
treee8523769180eae68c3029bd9796a5ea60d5ed464
parent5d581084067d7f5d16a73210d2219ac711a8a987
spi: dw-mid: avoid potential NULL dereference

commit c9dafb27c84412fe4b17c3b94cc4ffeef5df1833 upstream.

When DMA descriptor allocation fails we should not try to assign any fields in
the bad descriptor. The patch adds the necessary checks for that.

Fixes: 7063c0d942a1 (spi/dw_spi: add DMA support)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-dw-mid.c