ALSA: hda - Don't register a cb func if it is registered already
authorHui Wang <hui.wang@canonical.com>
Wed, 30 Sep 2020 05:51:46 +0000 (13:51 +0800)
committerTakashi Iwai <tiwai@suse.de>
Wed, 30 Sep 2020 10:56:32 +0000 (12:56 +0200)
commitf4794c6064a83d2c57b264bd299c367d172d1044
tree91119f8e7ee2cd196e5eb57ceb9785ab96e672a0
parent13468bfa8c58731dc9ecda1cd9b22a191114f944
ALSA: hda - Don't register a cb func if it is registered already

If the caller of enable_callback_mst() passes a cb func, the callee
function will malloc memory and link this cb func to the list
unconditionally. This will introduce problem if caller is in the
hda_codec_ops.init() since the init() will be repeatedly called in the
codec rt_resume().

So far, the patch_hdmi.c and patch_ca0132.c call enable_callback_mst()
in the hda_codec_ops.init().

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200930055146.5665-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_jack.c