ALSA: hda: fix NULL pointer dereference during suspend
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Tue, 28 Jul 2020 23:10:11 +0000 (16:10 -0700)
committerTakashi Iwai <tiwai@suse.de>
Wed, 29 Jul 2020 07:54:49 +0000 (09:54 +0200)
commit7fcd9bb5acd01250bcae1ecc0cb8b8d4bb5b7e63
treea8f3849dafc67c77ff2652fc0655d57164e80a13
parentc2c3657f0aedb8736a0fb7b2b1985adfb86e7802
ALSA: hda: fix NULL pointer dereference during suspend

When the ASoC card registration fails and the codec component driver
never probes, the codec device is not initialized and therefore
memory for codec->wcaps is not allocated. This results in a NULL pointer
dereference when the codec driver suspend callback is invoked during
system suspend. Fix this by returning without performing any actions
during codec suspend/resume if the card was not registered successfully.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200728231011.1454066-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c