Re: [PATCH 05/10] ASoC: Intel: avs: Clean up streams if their initialization fails

Cezary Rojewski <[email protected]>
Newsgroups gmane.linux.sound
Message-ID <[email protected]>
On 8/27/2026 4:34 PM, Mark Brown wrote:
> On Thu, Aug 27, 2026 at 03:15:05PM +0200, Cezary Rojewski wrote:
>> When streams are being initialized the memory allocation may fail.
>> Have an error path and return early if that is the case.
> 
>> +err:
>> +	snd_hdac_ext_stream_free_all(bus);
>> +	return ret;
> 
> I think this needs a snd_hdac_bus_free_stream_pages(), or possibly that
> should be pulled inside the cleanup.

I agree, snd_hdac_bus_alloc_stream_pages() situation does not look 
clean. However, I'm leaning towards adding an error path to said function.

If a call to snd_hdac_bus_alloc_stream_pages() fails, I'd expect BDLs, 
bus->rb and bus->posbuf invalidated before the function leaves its scope.

That asks for a separate patch.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.