Commit aa2fbece authored by Shuhao Fu's avatar Shuhao Fu Committed by Takashi Iwai
Browse files

ALSA: hda: cs35l56: Put ACPI device after setting companion



acpi_dev_get_first_match_dev() returns a refcounted ACPI device and
callers are expected to balance it with acpi_dev_put().

When no companion is already attached, cs35l56_hda_read_acpi() looks
up an ACPI device and sets it with ACPI_COMPANION_SET(), but leaves
the lookup reference held.

ACPI_COMPANION_SET() does not take ownership of that reference, so
drop it with acpi_dev_put() after attaching the companion.

Fixes: 73cfbfa9 ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")
Signed-off-by: default avatarShuhao Fu <sfual@cse.ust.hk>
Tested-by: default avatarSimon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260428080139.GA1649104@chcpu16
parent 918be519
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1041,6 +1041,7 @@ static int cs35l56_hda_read_acpi(struct cs35l56_hda *cs35l56, int hid, int id)
			return -ENODEV;
		}
		ACPI_COMPANION_SET(cs35l56->base.dev, adev);
		acpi_dev_put(adev);
	}

	/* Initialize things that could be overwritten by a fixup */