From: Takashi Iwai Date: Tue, 14 Aug 2007 13:15:52 +0000 (+0200) Subject: [ALSA] hda-intel - Fix NULL dereference in resume X-Git-Tag: v2.6.24-rc1~832^2~178 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d99f312629802f4c45306ee07618ee4978b4adc;p=linux-2.6 [ALSA] hda-intel - Fix NULL dereference in resume codec->patch_ops.init can be NULL. Check before calling it. Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index efd56a3396..fc1ddf408b 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -1677,7 +1677,8 @@ static void hda_call_codec_resume(struct hda_codec *codec) if (codec->patch_ops.resume) codec->patch_ops.resume(codec); else { - codec->patch_ops.init(codec); + if (codec->patch_ops.init) + codec->patch_ops.init(codec); snd_hda_codec_resume_amp(codec); snd_hda_codec_resume_cache(codec); }