Skip to content

Commit

Permalink
ALSA: hda: intel-sdw-acpi: fix usage of device_get_named_child_node()
Browse files Browse the repository at this point in the history
The documentation for device_get_named_child_node() mentions this
important point:

"
The caller is responsible for calling fwnode_handle_put() on the
returned fwnode pointer.
"

Add fwnode_handle_put() to avoid a leaked reference.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fixes: 08c2a4b ("ALSA: hda: move Intel SoundWire ACPI scan to dedicated module")
Message-ID: <20240426152731.38420-1-pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
plbossart authored and tiwai committed Apr 29, 2024
1 parent 79ac4c1 commit c158cf9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/hda/intel-sdw-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ static bool is_link_enabled(struct fwnode_handle *fw_node, u8 idx)
"intel-quirk-mask",
&quirk_mask);

fwnode_handle_put(link);

if (quirk_mask & SDW_INTEL_QUIRK_MASK_BUS_DISABLE)
return false;

Expand Down

0 comments on commit c158cf9

Please sign in to comment.