linux-stable/sound
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
..
ac97
aoa Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
arm
atmel
core ALSA: pcm: Test for "silence" field in struct "pcm_format_data" 2022-04-20 09:34:19 +02:00
drivers ALSA: mtpav: Don't call card private_free at probe error path 2022-04-20 09:34:12 +02:00
firewire ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes 2022-05-12 12:30:01 +02:00
hda ALSA: hda: Make proper use of timecounter 2022-01-27 11:04:07 +01:00
i2c
isa ALSA: sc6000: Fix the missing snd_card_free() call at probe error 2022-04-20 09:34:08 +02:00
mips
oss
parisc parisc architecture updates for kernel 5.15: 2021-09-02 13:16:00 -07:00
pci ALSA: hda/realtek: Add quirk for Yoga Duet 7 13ITL6 speakers 2022-05-12 12:30:01 +02:00
pcmcia
ppc
sh
soc ASoC: SOF: Fix NULL pointer exception in sof_pci_probe callback 2022-05-18 10:26:52 +02:00
sparc
spi ALSA: spi: Add check for clk_enable() 2022-04-08 14:23:19 +02:00
synth ALSA: synth: missing check for possible NULL after the call to kstrdup 2021-11-18 19:15:55 +01:00
usb ALSA: usb-audio: Fix undefined behavior due to shift overflowing the constant 2022-04-27 14:38:55 +02:00
virtio
x86 ALSA: intel_hdmi: Fix the missing snd_card_free() call at probe error 2022-04-20 09:34:07 +02:00
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c