Subject: Re: [PATCH] ASoC: Intel: avs: replace strcmp with sysfs_streq

From: Amadeusz Sławiński <[email-masked]>
Date: Tue, 23 Dec 2025 19:24:09 +0100

On Tue, 23 Dec 2025 17:07:04 +0000
Mark Brown <[email-masked]> wrote:

> On Mon, 22 Dec 2025 00:25:31 +0530, Brahmajit Das wrote:
> > allmodconfig failes to build with GCC 16 with the following build error
> > 
> > sound/soc/intel/avs/path.c:137:38: error: ‘strcmp’ reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
> >   137 |         return id->id == id2->id && !strcmp(id->tplg_name, id2->tplg_name);
> >       |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >   ‘avs_condpaths_walk’: events 1-3
> >   137 |         return id->id == id2->id && !strcmp(id->tplg_name, id2->tplg_name);
> >       |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >       |                                  |   |
> >       |                                  |   (3) warning happens here
> >       |                                  (1) when the condition is evaluated to true
> > ......
> >   155 |         if (id->id != path->template->owner->id ||
> >       |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >       |                                                 |
> >       |                                                 (2) when the condition is evaluated to false
> >   156 |             strcmp(id->tplg_name, path->template->owner->owner->name))
> >       |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from sound/soc/intel/avs/path.h:14,
> >                  from sound/soc/intel/avs/path.c:15:
> > sound/soc/intel/avs/topology.h: In function ‘avs_condpaths_walk’:
> > sound/soc/intel/avs/topology.h:152:13: note: at offset 4 into source object ‘id’ of size 4
> >   152 |         u32 id;
> >       |             ^~
> > 
> > [...]  
> 
> Applied to
> 

Missed this patch and it got applied...

Anyway above log seems bit weird, as this struct should be well defined:
struct avs_tplg_path_template_id {
	u32 id;
	char tplg_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
};
are you sure that SNDRV_CTL_ELEM_ID_NAME_MAXLEN didn't somehow end up
being 0? As that would be a real problem.

sysfs_streq is similar to strcmp, but with different order of checks so
it will just mask an issue, if there really is one. And reading its
description I don't think it should be used in this case.

Can you instead try reverting it and hardcoding value in struct like:
struct avs_tplg_path_template_id {
	u32 id;
	char tplg_name[44];
};
to see if the error is gone?