linux-stable/sound
Ross Zwisler 6fee39874d ASoC: Intel: avoid Oops if DMA setup fails
commit 0efa3334d6 upstream.

Currently in sst_dsp_new() if we get an error return from sst_dma_new()
we just print an error message and then still complete the function
successfully.  This means that we are trying to run without sst->dma
properly set up, which will result in NULL pointer dereference when
sst->dma is later used.  This was happening for me in
sst_dsp_dma_get_channel():

        struct sst_dma *dma = dsp->dma;
	...
        dma->ch = dma_request_channel(mask, dma_chan_filter, dsp);

This resulted in:

   BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
   IP: sst_dsp_dma_get_channel+0x4f/0x125 [snd_soc_sst_firmware]

Fix this by adding proper error handling for the case where we fail to
set up DMA.

This change only affects Haswell and Broadwell systems.  Baytrail
systems explicilty opt-out of DMA via sst->pdata->resindex_dma_base
being set to -1.

Signed-off-by: Ross Zwisler <zwisler@google.com>
Cc: stable@vger.kernel.org
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-10 17:54:11 +02:00
..
ac97 ALSA: ac97: Fix of-node refcount unbalance 2019-03-27 14:14:41 +09:00
aoa ALSA: snd-aoa: add of_node_put() in error path 2018-06-29 20:35:14 +02:00
arm ASoC: pxa2xx-pcm-lib: fix indenting 2018-06-29 12:05:05 +01:00
atmel
core ALSA: info: Fix racy addition/deletion of nodes 2019-04-27 09:36:40 +02:00
drivers ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration 2019-04-20 09:15:56 +02:00
firewire ALSA: dice: add support for Solid State Logic Duende Classic/Mini 2019-04-05 22:33:13 +02:00
hda ALSA: hda: Extend i915 component bind timeout 2019-03-19 13:12:41 +01:00
i2c ALSA: i2c: Remove empty init and exit 2018-08-03 16:11:43 +02:00
isa ALSA: sb8: add a check for request_region 2019-04-20 09:15:55 +02:00
mips ALSA: pcm: Nuke snd_pcm_lib_mmap_vmalloc() 2018-07-18 08:24:29 +02:00
oss treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
parisc
pci ALSA: hda/realtek - Apply the fixup for ASUS Q325UAR 2019-05-08 07:21:43 +02:00
pcmcia Merge branch 'for-linus' into topic/virmidi 2018-07-29 22:39:29 +02:00
ppc powerpc/ps3: Set driver coherent_dma_mask 2018-07-20 12:50:37 +10:00
sh
soc ASoC: Intel: avoid Oops if DMA setup fails 2019-05-10 17:54:11 +02:00
sparc ALSA: sparc: Fix invalid snd_free_pages() at error path 2018-12-05 19:32:08 +01:00
spi
synth ALSA: emux: Fix potential Spectre v1 vulnerabilities 2019-01-09 17:38:36 +01:00
usb ALSA: line6: use dynamic buffers 2019-05-05 14:42:41 +02:00
x86 ALSA: x86: Fix runtime PM for hdmi-lpe-audio 2019-03-27 14:14:41 +09:00
xen ALSA: xen: Use standard pcm_format_to_bits() for ALSA format bits 2018-07-27 09:05:34 +02:00
ac97_bus.c
Kconfig ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver 2018-05-16 12:58:36 +02:00
last.c
Makefile ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver 2018-05-16 12:58:36 +02:00
sound_core.c sound: Use octal not symbolic permissions 2018-05-28 11:27:20 +02:00