From: Takashi Iwai Date: Sun, 20 Aug 2023 17:26:34 +0000 (+0200) Subject: ALSA: hda/tas2781: Fix acpi device refcount leak at tas2781_read_acpi() X-Git-Tag: v6.6.7~1940^2~15^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c80cc055b3f9fb72606d58c27eb2486c4b919a7;p=platform%2Fkernel%2Flinux-starfive.git ALSA: hda/tas2781: Fix acpi device refcount leak at tas2781_read_acpi() The error path at tas2781_read_acpi() doesn't release the acpi_device adev but releases another device physdev instead. This results in a refcount leak. Fix it by replacing with the right object. Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Reported-by: Pierre-Louis Bossart Closes: https://lore.kernel.org/r/9f910785-e856-1539-e3e4-c9817af5fe67@linux.intel.com Link: https://lore.kernel.org/r/20230820172635.22236-1-tiwai@suse.de Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index 35dafc4..0968ae9 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -118,7 +118,7 @@ static int tas2781_read_acpi(struct tasdevice_priv *p, const char *hid) err: dev_err(p->dev, "read acpi error, ret: %d\n", ret); - put_device(physdev); + acpi_dev_put(adev); return ret; }