Merge branch 'for-next' into for-linus
[deliverable/linux.git] / sound / pci / hda / hda_codec.c
index 83741887faa189c1700abc34bebbd3c55234384d..9913be8532ab765651ae5166953d9e25281ce83c 100644 (file)
@@ -3584,6 +3584,12 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,
        bool reset;
 
        spdif = snd_hda_spdif_out_of_nid(codec, nid);
+       /* Add sanity check to pass klockwork check.
+        * This should never happen.
+        */
+       if (WARN_ON(spdif == NULL))
+               return;
+
        curr_fmt = snd_hda_codec_read(codec, nid, 0,
                                      AC_VERB_GET_STREAM_FORMAT, 0);
        reset = codec->spdif_status_reset &&
@@ -3768,7 +3774,7 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
        spdif = snd_hda_spdif_out_of_nid(codec, mout->dig_out_nid);
        if (mout->dig_out_nid && mout->share_spdif &&
            mout->dig_out_used != HDA_DIG_EXCLUSIVE) {
-               if (chs == 2 &&
+               if (chs == 2 && spdif != NULL &&
                    snd_hda_is_supported_format(codec, mout->dig_out_nid,
                                                format) &&
                    !(spdif->status & IEC958_AES0_NONAUDIO)) {
This page took 0.024354 seconds and 5 git commands to generate.