Explorar o código

[ALSA] hda-intel - Fix NULL dereference in resume

codec->patch_ops.init can be NULL.  Check before calling it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Takashi Iwai %!s(int64=18) %!d(string=hai) anos
pai
achega
9d99f31262
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      sound/pci/hda/hda_codec.c

+ 2 - 1
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);
 	}