Skip to content

Commit 17a1eab

Browse files
committed
ALSA: hda/tas2781: Fix PM refcount unbalance at tas2781_hda_bind()
The error path of tas2781_hda_bind() needs to release PM refcount as well. Modify the code flow to handle properly. Fixes: 5be27f1 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Closes: https://lore.kernel.org/r/9f910785-e856-1539-e3e4-c9817af5fe67@linux.intel.com Link: https://lore.kernel.org/r/20230820172635.22236-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 1c80cc0 commit 17a1eab

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

sound/pci/hda/tas2781_hda_i2c.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,15 +608,13 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
608608
strscpy(comps->name, dev_name(dev), sizeof(comps->name));
609609

610610
ret = tascodec_init(tas_priv, codec, tasdev_fw_ready);
611-
if (ret)
612-
return ret;
613-
614-
comps->playback_hook = tas2781_hda_playback_hook;
611+
if (!ret)
612+
comps->playback_hook = tas2781_hda_playback_hook;
615613

616614
pm_runtime_mark_last_busy(dev);
617615
pm_runtime_put_autosuspend(dev);
618616

619-
return 0;
617+
return ret;
620618
}
621619

622620
static void tas2781_hda_unbind(struct device *dev,

0 commit comments

Comments
 (0)