]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: hda - Release assigned pin/cvt at error path of hdmi_pcm_open()
authorTakashi Iwai <tiwai@suse.de>
Fri, 1 Feb 2013 13:01:27 +0000 (14:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Feb 2013 14:59:02 +0000 (06:59 -0800)
commit 2ad779b7329d6894a80df94e693e72eaa0d56790 upstream.

If the driver detects and invalid ELD, it gives an open error.
But it forgot to release the assigned pin, converter and spdif ctls
before returning.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/patch_hdmi.c

index d1b805aefa5747c9048b46729107f87fb0d23413..f694dd77ad449e05bc7241ebe57c35f9c087a365 100644 (file)
@@ -924,8 +924,12 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
        if (!static_hdmi_pcm && eld->eld_valid) {
                snd_hdmi_eld_update_pcm_info(eld, hinfo);
                if (hinfo->channels_min > hinfo->channels_max ||
-                   !hinfo->rates || !hinfo->formats)
+                   !hinfo->rates || !hinfo->formats) {
+                       per_cvt->assigned = 0;
+                       hinfo->nid = 0;
+                       snd_hda_spdif_ctls_unassign(codec, pin_idx);
                        return -ENODEV;
+               }
        }
 
        /* Store the updated parameters */