linux/sound/soc/sof
Ajit Kumar Pandey 4bf5bc44ea ASoC: SOF: Fix NULL pointer exception in sof_pci_probe callback
[ Upstream commit c61711c1c9 ]

We are accessing "desc->ops" in sof_pci_probe without checking "desc"
pointer. This results in NULL pointer exception if pci_id->driver_data
i.e desc pointer isn't defined in sof device probe:

BUG: kernel NULL pointer dereference, address: 0000000000000060
PGD 0 P4D 0
Oops: 0000 [#1] PREEMPT SMP NOPTI
RIP: 0010:sof_pci_probe+0x1e/0x17f [snd_sof_pci]
Code: Unable to access opcode bytes at RIP 0xffffffffc043dff4.
RSP: 0018:ffffac4b03b9b8d8 EFLAGS: 00010246

Add NULL pointer check for sof_dev_desc pointer to avoid such exception.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220426183357.102155-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-05-18 10:26:52 +02:00
..
imx ASoC: SOF: Add missing of_node_put() in imx8m_probe 2022-04-08 14:23:21 +02:00
intel ASoC: SOF: Intel: Fix build error without SND_SOC_SOF_PCI_DEV 2022-04-08 14:24:15 +02:00
xtensa ASoC: SOF: Fix DSP oops stack dump output contents 2021-09-15 13:07:51 +01:00
compress.c ASoC: SOF: Intel: Constify sof_probe_compressed_ops 2021-06-01 14:05:15 +01:00
compress.h ASoC: SOF: Intel: Constify sof_probe_compressed_ops 2021-06-01 14:05:15 +01:00
control.c ASoC: SOF: control: override volume info callback 2020-11-20 13:49:05 +00:00
core.c ASoC: SOF: loader: release_firmware() on load failure to avoid batching 2021-09-16 14:01:54 +01:00
debug.c ASoC: SOF: remove superfluous NULL check in debugfs read 2021-03-16 13:25:46 +00:00
ipc.c ASoC: SOF: relax ABI checks and avoid unnecessary warnings 2021-02-11 17:31:56 +00:00
Kconfig ASoC: SOF: add Kconfig option for probe workqueues 2021-04-12 17:05:50 +01:00
loader.c ASoC: SOF: loader: Re-phrase the missing firmware error to avoid duplication 2021-09-16 14:01:55 +01:00
Makefile ASoC: SOF: pci: split PCI into different drivers 2021-03-02 15:32:00 +01:00
nocodec.c ASOC: SOF: simplify nocodec mode 2021-04-12 17:05:55 +01:00
ops.c ASoC: SOF: modify the SOF_DBG flags 2020-12-11 13:22:57 +00:00
ops.h ASoC: SOF: ops: don't return void value 2021-05-21 13:13:40 +01:00
pcm.c ASoC: SOF: pcm: export snd_pcm_dai_link_fixup 2021-04-12 17:05:54 +01:00
pm.c ASoC: SOF: reset enabled_cores state at suspend 2021-06-01 14:03:01 +01:00
probe.c ASoC: SOF/Intel: clarify SPDX license with GPL-2.0-only 2020-05-01 17:45:24 +01:00
probe.h ASoC: SOF: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00
sof-acpi-dev.c ASoC: SOF: Check desc->ops directly in acpi/pci/of probe functions 2021-05-21 13:13:35 +01:00
sof-acpi-dev.h ASoC: SOF: ACPI: avoid reverse module dependency 2021-03-02 15:31:40 +01:00
sof-audio.c ASoC: SOF: add a helper to get topology configured bclk 2021-07-11 23:48:30 +01:00
sof-audio.h ASoC: SOF: parse multiple SSP DAI and hw configs 2021-03-29 17:28:17 +01:00
sof-of-dev.c ASoC: SOF: Check desc->ops directly in acpi/pci/of probe functions 2021-05-21 13:13:35 +01:00
sof-pci-dev.c ASoC: SOF: Fix NULL pointer exception in sof_pci_probe callback 2022-05-18 10:26:52 +02:00
sof-pci-dev.h ASoC: SOF: pci: split PCI into different drivers 2021-03-02 15:32:00 +01:00
sof-priv.h ASoC: SOF: change signature of set_mach_params() callback 2021-04-12 17:05:52 +01:00
topology.c ASoC: SOF: topology: do not power down primary core during topology removal 2021-11-18 19:16:50 +01:00
trace.c ASoC: SOF: trace: Omit error print when waking up trace sleepers 2021-09-17 13:16:36 +01:00
utils.c ASoC: SOF/Intel: clarify SPDX license with GPL-2.0-only 2020-05-01 17:45:24 +01:00