Re: [PATCH 09/10] ASoC: Intel: avs: Refactor and fix init_config access

Cezary Rojewski <[email protected]>
Newsgroups gmane.linux.sound
Message-ID <[email protected]>
On 8/27/2026 4:40 PM, Mark Brown wrote:
> On Thu, Aug 27, 2026 at 03:15:09PM +0200, Cezary Rojewski wrote:
>> Existing code accesses enties found in ->init_configs array through
>> indexes that are part of ->config_ids array.  Those two are limited by:
>> ->num_init_configs and ->num_config_ids respectively.  Using ID larger
>> or equal to ->num_init_configs leads to out-of-bounds access:
> 
>> -	acomp = to_avs_soc_component(mod->template->owner->owner->owner->owner->comp);
>> +	acomp = to_avs_soc_component(template->owner->owner->owner->owner->comp);
>>   
>> -	u32 num_ids = mod->template->num_config_ids;
>> -	u32 *ids = mod->template->config_ids;
>> -
>> -	for (int i = 0; i < num_ids; i++) {
>> -		struct avs_tplg_init_config *config = &acomp->tplg->init_configs[ids[i]];
>> +	for (int i = 0; i < template->num_init_configs; i++) {
>> +		struct avs_tplg_init_config *config = template->init_configs[i];
> 
> I don't see any users of acomp left after this refactoring?


Good catch! Ack.
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.