mirror_ubuntu-kernels/sound/soc/intel/common
Ross Zwisler 0efa3334d6
ASoC: Intel: avoid Oops if DMA setup fails
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>
2019-05-03 14:55:18 +09:00
..
Makefile ASoC: Intel: common: add ACPI matching tables for ICL 2018-12-03 12:02:13 +00:00
soc-acpi-intel-bxt-match.c ASoC: Intel: soc-acpi: bxt-match: remove asoc_plat_name field 2019-02-12 16:54:50 +00:00
soc-acpi-intel-byt-match.c ASoC: Intel: soc-acpi: byt-match: remove asoc_plat_name field 2019-02-12 16:55:00 +00:00
soc-acpi-intel-cht-match.c ASoC: Intel: soc-acpi: cht-match: remove asoc_plat_name field 2019-02-12 16:55:09 +00:00
soc-acpi-intel-cnl-match.c ASoC: Intel: soc-acpi: cnl-match.c: remove asoc_plat_name field 2019-02-12 16:55:48 +00:00
soc-acpi-intel-glk-match.c ASoC: Intel: common: add Geminilake Realtek+Maxim machine driver entry 2019-05-02 10:46:10 +09:00
soc-acpi-intel-hda-match.c ASoC: Intel: hda-match: remove prefix for SOF files 2019-02-12 16:54:22 +00:00
soc-acpi-intel-hsw-bdw-match.c ASoC: Intel: soc-acpi: hsw-bdw-match: remove asoc_plat_name field 2019-02-12 16:55:29 +00:00
soc-acpi-intel-icl-match.c ASoC: Intel: soc-acpi: icl-match: remove asoc_plat_name field 2019-02-12 16:55:38 +00:00
soc-acpi-intel-kbl-match.c ASoC: Intel: Boards: Add Maxim98373 support 2019-02-26 11:45:36 +00:00
soc-acpi-intel-skl-match.c ASoC: Intel: move SKL+ codec ACPI tables to common directory 2018-06-19 15:47:02 +01:00
sst-acpi.c ASoC: Intel: move all ACPI match tables to common module 2017-10-21 11:21:31 +01:00
sst-dsp-priv.h treewide: correct "differenciate" and "instanciate" typos 2018-08-23 18:48:43 -07:00
sst-dsp.c ASoC: Intel: Skylake: Remove second shim read in register_poll 2017-12-06 17:44:50 +00:00
sst-dsp.h ASoC: intel: Fix sst-dsp dependency on dw stuff 2016-07-11 18:19:23 +01:00
sst-firmware.c ASoC: Intel: avoid Oops if DMA setup fails 2019-05-03 14:55:18 +09:00
sst-ipc.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
sst-ipc.h ASoC: intel: Replace kthread with work 2016-11-30 17:41:13 +00:00