summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2026-07-29 10:37:21 +0200
committerTakashi Iwai <tiwai@suse.de>2026-07-31 12:44:35 +0200
commitf37eed135b97501ae06cfea4b9bb119af499f716 (patch)
tree44cb5a3aa0751929379a54ae5061415bd3380b8f
parentbff808bc58172af982d10d200ceb30d5bdb6a8b4 (diff)
downloadlinux-next-f37eed135b97501ae06cfea4b9bb119af499f716.tar.gz
linux-next-f37eed135b97501ae06cfea4b9bb119af499f716.zip
ALSA: hda: intel: Use auto-cleanup for firmware loading
Simplify the code to manage the firmware loading with __free(firmware) auto-cleanup. Only the code refactoring, no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20260729083735.120219-4-tiwai@suse.de
-rw-r--r--sound/hda/controllers/intel.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/hda/controllers/intel.c b/sound/hda/controllers/intel.c
index 9a5c61f43011..8f592032ac15 100644
--- a/sound/hda/controllers/intel.c
+++ b/sound/hda/controllers/intel.c
@@ -2389,7 +2389,7 @@ static int azx_probe_continue(struct azx *chip)
#ifdef CONFIG_SND_HDA_PATCH_LOADER
if (patch[dev] && *patch[dev]) {
- const struct firmware *fw = NULL;
+ const struct firmware *fw __free(firmware) = NULL;
dev_info(&pci->dev, "Applying patch firmware '%s'\n",
patch[dev]);
@@ -2398,7 +2398,6 @@ static int azx_probe_continue(struct azx *chip)
"Cannot load firmware, continue without patching\n");
} else {
err = snd_hda_load_patch(&chip->bus, fw->size, fw->data);
- release_firmware(fw);
if (err < 0)
goto out_free;
}