summaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-08-20 20:26:35 +0300
committerTakashi Iwai <tiwai@suse.de>2023-08-21 17:20:55 +0300
commit17a1eab7b70d85fc5711f37bb6e530b771736bb7 (patch)
treefe309bb87fd0fdcbf5f3eae5f8a392734cd86c45 /sound/pci
parent1c80cc055b3f9fb72606d58c27eb2486c4b919a7 (diff)
downloadlinux-17a1eab7b70d85fc5711f37bb6e530b771736bb7.tar.xz
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: 5be27f1e3ec9 ("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>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/tas2781_hda_i2c.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
index 0968ae915fd0..aa9ce3837336 100644
--- a/sound/pci/hda/tas2781_hda_i2c.c
+++ b/sound/pci/hda/tas2781_hda_i2c.c
@@ -608,15 +608,13 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
strscpy(comps->name, dev_name(dev), sizeof(comps->name));
ret = tascodec_init(tas_priv, codec, tasdev_fw_ready);
- if (ret)
- return ret;
-
- comps->playback_hook = tas2781_hda_playback_hook;
+ if (!ret)
+ comps->playback_hook = tas2781_hda_playback_hook;
pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
- return 0;
+ return ret;
}
static void tas2781_hda_unbind(struct device *dev,