OpenCloudOS-Kernel/sound/soc/sof
Ajit Kumar Pandey c61711c1c9
ASoC: SOF: Fix NULL pointer exception in sof_pci_probe callback
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>
2022-04-27 14:15:21 +01:00
..
amd ASoC: SOF: Make pcm_hw_params snd_sof_dsp_ops callback IPC neutral 2022-03-11 13:41:01 +00:00
imx ASoC: SOF: imx: Convert to use the generic set_stream_data_offset ops 2022-03-11 13:41:08 +00:00
intel ASoC: Fixes for v5.18 2022-03-30 14:04:22 +02:00
mediatek ASoC: SOF: OF: Avoid reverse module dependency 2021-12-15 14:02:50 +00:00
xtensa ASoC: SOF: dsp_arch_ops: add kernel log level parameter for oops and stack 2021-12-23 13:38:25 +00:00
Kconfig ASoC: SOF: Convert the generic probe support to SOF client 2022-02-10 15:19:12 +00:00
Makefile ASoC: SOF: Introduce IPC3 PCM hw_free op 2022-03-18 16:04:47 +00:00
compress.c ASoC: SOF: compress: fix null check after dereference 2022-03-11 13:40:54 +00:00
control.c ASoC: SOF: Add bytes_ext control IPC ops for IPC3 2022-03-18 16:04:44 +00:00
core.c ASoC: SOF: Introduce struct snd_sof_dai_link 2022-03-16 16:38:54 +00:00
debug.c ASoC: SOF: debug: clarify operator precedence 2022-03-07 13:12:54 +00:00
iomem-utils.c ASoC: SOF: Split up utils.c into sof-utils and iomem-utils 2022-02-10 15:19:04 +00:00
ipc.c ASoC: SOF: Introduce IPC3 PCM hw_free op 2022-03-18 16:04:47 +00:00
ipc3-control.c ASoC: SOF: Add bytes_ext control IPC ops for IPC3 2022-03-18 16:04:44 +00:00
ipc3-ops.h ASoC: SOF: Introduce IPC3 PCM hw_free op 2022-03-18 16:04:47 +00:00
ipc3-pcm.c ASoC: SOF: Add dai_link_fixup PCM op for IPC3 2022-03-18 16:04:50 +00:00
ipc3-topology.c ASoC: SOF: Add a new dai_get_clk topology IPC op 2022-03-18 16:04:53 +00:00
ipc3.c ASoC: SOF: Introduce IPC3 PCM hw_free op 2022-03-18 16:04:47 +00:00
loader.c ASoC: SOF: Set SOF_FW_BOOT_FAILED in case we have failure during boot 2021-12-23 13:38:20 +00:00
nocodec.c ASOC: SOF: simplify nocodec mode 2021-04-12 17:05:55 +01:00
ops.c ASoC: SOF: ops: Always print DSP Panic message but use different message 2021-12-23 13:38:24 +00:00
ops.h ASoC: SOF: Remove ipc_pcm_params() ops 2022-03-11 13:41:09 +00:00
pcm.c ASoC: SOF: Add dai_link_fixup PCM op for IPC3 2022-03-18 16:04:50 +00:00
pm.c ASoC: SOF: topology: Add ops for setting up and tearing down pipelines 2022-03-18 16:04:52 +00: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 new dai_get_clk topology IPC op 2022-03-18 16:04:53 +00:00
sof-audio.h ASoC: SOF: Add a new dai_get_clk topology IPC op 2022-03-18 16:04:53 +00:00
sof-client-ipc-flood-test.c ASoC: SOF: Convert the generic IPC flood test into SOF client 2022-02-10 15:19:09 +00:00
sof-client-ipc-msg-injector.c ASoC: SOF: ipc-msg-injector: Use devm_kzalloc() for the rx_buffer 2022-03-09 17:34:59 +00:00
sof-client-probes.c ASoC: SOF: Convert the generic probe support to SOF client 2022-02-10 15:19:12 +00:00
sof-client-probes.h ASoC: SOF: Convert the generic probe support to SOF client 2022-02-10 15:19:12 +00:00
sof-client.c ASoC: SOF: Convert the generic IPC message injector into SOF client 2022-02-10 15:19:10 +00:00
sof-client.h ASoC: SOF: Introduce IPC SOF client support 2022-02-10 15:19:06 +00:00
sof-of-dev.c ASoC: SOF: OF: Avoid reverse module dependency 2021-12-15 14:02:50 +00:00
sof-of-dev.h ASoC: SOF: OF: Avoid reverse module dependency 2021-12-15 14:02:50 +00:00
sof-pci-dev.c ASoC: SOF: Fix NULL pointer exception in sof_pci_probe callback 2022-04-27 14:15:21 +01: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: Introduce IPC-specific PCM ops 2022-03-18 16:04:45 +00:00
sof-utils.c ASoC: SOF: Split up utils.c into sof-utils and iomem-utils 2022-02-10 15:19:04 +00:00
sof-utils.h ASoC: SOF: Split up utils.c into sof-utils and iomem-utils 2022-02-10 15:19:04 +00:00
stream-ipc.c ASoC: SOF: Remove ipc_pcm_params() ops 2022-03-11 13:41:09 +00:00
topology.c ASoC: SOF: topology: Fix memory leak in sof_control_load() 2022-04-07 18:29:37 +01:00
trace.c ASoC: SOF: trace: Use proper DMA direction for the trace data buffer 2022-03-11 13:40:55 +00:00