From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: <broonie@kernel.org>, <tiwai@suse.com>, <perex@perex.cz>,
<amade@asmblr.net>, <linux-sound@vger.kernel.org>
Subject: Re: [PATCH v3 02/10] ALSA: hda: ext: Clean up streams if their initialization fails
Date: Tue, 1 Sep 2026 13:49:45 +0200 [thread overview]
Message-ID: <1cbe18e6-f2f8-49fb-b49d-7fac35dcaf97@intel.com> (raw)
In-Reply-To: <87se3tci4e.wl-tiwai@suse.de>
On 9/1/2026 1:42 PM, Takashi Iwai wrote:
> On Mon, 31 Aug 2026 18:42:25 +0200,
> Cezary Rojewski wrote:
>> @@ -94,6 +94,7 @@ int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
>> int (*setup_op)(struct hdac_stream *, bool);
>> int stream_tag = 0;
>> int i, tag, idx = start_idx;
>> + struct hdac_stream *s, *_s;
>>
>> if (pci->device == PCI_DEVICE_ID_INTEL_HDA_APL)
>> setup_op = snd_hdac_apl_host_stream_setup;
>> @@ -103,7 +104,7 @@ int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
>> for (i = 0; i < num_stream; i++) {
>> struct hdac_ext_stream *hext_stream = kzalloc_obj(*hext_stream);
>> if (!hext_stream)
>> - return -ENOMEM;
>> + goto err_nomem;
>> tag = ++stream_tag;
>> snd_hdac_ext_stream_init(bus, hext_stream, idx, dir, tag);
>> idx++;
>> @@ -112,6 +113,14 @@ int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
>>
>> return 0;
>>
>> +err_nomem:
>> + list_for_each_entry_safe(s, _s, &bus->stream_list, list) {
>> + struct hdac_ext_stream *hext_stream = stream_to_hdac_ext_stream(s);
>> +
>> + list_del(&s->list);
>> + kfree(hext_stream);
>> + }
>
> We may reuse snd_hdac_ext_stream_free_all() but without calling
> snd_hdac_ext_stream_decouple(), too?
Majority of code found within sound/hda/core/ext/ needs some lifting the
goal behind this patchset is not it. Moving the decouple function away
from snd_hdac_ext_stream_free_all() is a refactor. I'm against adding
an if-statement in snd_hdac_ext_stream_free_all(). However, I could
replace the error path with snd_hdac_ext_stream_free_all() for now and
live with the superfluous operation till the refactor : )
next prev parent reply other threads:[~2026-09-01 11:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 16:42 [PATCH v3 00/10] ALSA/ASoC: Intel: avs: HDAudio bus and general fixes Cezary Rojewski
2026-08-31 16:42 ` [PATCH v3 01/10] ALSA: hda: ext: Clean up links if their initialization fails Cezary Rojewski
2026-09-01 11:39 ` Takashi Iwai
2026-09-01 11:58 ` Cezary Rojewski
2026-08-31 16:42 ` [PATCH v3 02/10] ALSA: hda: ext: Clean up streams " Cezary Rojewski
2026-09-01 11:42 ` Takashi Iwai
2026-09-01 11:49 ` Cezary Rojewski [this message]
2026-08-31 16:42 ` [PATCH v3 03/10] ASoC: Intel: avs: Clean up the bus when its " Cezary Rojewski
2026-08-31 16:42 ` [PATCH v3 04/10] ASoC: Intel: avs: Clean up the bus when fetching ML caps fails Cezary Rojewski
2026-08-31 16:42 ` [PATCH v3 05/10] ASoC: Intel: avs: Clean up streams if their initialization fails Cezary Rojewski
2026-08-31 16:42 ` [PATCH v3 06/10] ASoC: Intel: avs: Do not ignore -ENOENT when loading a topology Cezary Rojewski
2026-08-31 16:42 ` [PATCH v3 07/10] ASoC: Intel: avs: Cancel d0ix_work asynchrounously during recovery Cezary Rojewski
2026-08-31 16:42 ` [PATCH v3 08/10] ASoC: Intel: avs: Fix unbalanced module reference count Cezary Rojewski
2026-08-31 16:42 ` [PATCH v3 09/10] ASoC: Intel: avs: Refactor and fix init_config access Cezary Rojewski
2026-08-31 22:30 ` Mark Brown
2026-09-01 8:57 ` Cezary Rojewski
2026-09-01 11:28 ` Mark Brown
2026-08-31 16:42 ` [PATCH v3 10/10] ASoC: Intel: avs: hda: Constrain MSBs on startup Cezary Rojewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1cbe18e6-f2f8-49fb-b49d-7fac35dcaf97@intel.com \
--to=cezary.rojewski@intel.com \
--cc=amade@asmblr.net \
--cc=broonie@kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.