mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
ALSA: hda/generic: Use auto cleanup for temporary buffers
The release of temporary kmalloced buffers can be nicely handled via the standard __free(kfree). Only code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250827072916.31933-22-tiwai@suse.de
This commit is contained in:
parent
6b12178fa0
commit
ee0b0f5d32
|
|
@ -1984,7 +1984,7 @@ static int parse_output_paths(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct hda_gen_spec *spec = codec->spec;
|
struct hda_gen_spec *spec = codec->spec;
|
||||||
struct auto_pin_cfg *cfg = &spec->autocfg;
|
struct auto_pin_cfg *cfg = &spec->autocfg;
|
||||||
struct auto_pin_cfg *best_cfg;
|
struct auto_pin_cfg *best_cfg __free(kfree) = NULL;
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
int best_badness = INT_MAX;
|
int best_badness = INT_MAX;
|
||||||
int badness;
|
int badness;
|
||||||
|
|
@ -2000,10 +2000,8 @@ static int parse_output_paths(struct hda_codec *codec)
|
||||||
for (;;) {
|
for (;;) {
|
||||||
badness = fill_and_eval_dacs(codec, fill_hardwired,
|
badness = fill_and_eval_dacs(codec, fill_hardwired,
|
||||||
fill_mio_first);
|
fill_mio_first);
|
||||||
if (badness < 0) {
|
if (badness < 0)
|
||||||
kfree(best_cfg);
|
|
||||||
return badness;
|
return badness;
|
||||||
}
|
|
||||||
debug_badness("==> lo_type=%d, wired=%d, mio=%d, badness=0x%x\n",
|
debug_badness("==> lo_type=%d, wired=%d, mio=%d, badness=0x%x\n",
|
||||||
cfg->line_out_type, fill_hardwired, fill_mio_first,
|
cfg->line_out_type, fill_hardwired, fill_mio_first,
|
||||||
badness);
|
badness);
|
||||||
|
|
@ -2096,7 +2094,6 @@ static int parse_output_paths(struct hda_codec *codec)
|
||||||
if (spec->indep_hp && !indep_hp_possible(codec))
|
if (spec->indep_hp && !indep_hp_possible(codec))
|
||||||
spec->indep_hp = 0;
|
spec->indep_hp = 0;
|
||||||
|
|
||||||
kfree(best_cfg);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user