ASoC: Intel: avs: Support 16 TDMs in dynamic assignment
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Fri, 4 Apr 2025 09:03:37 +0000 (11:03 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 7 Apr 2025 14:08:03 +0000 (15:08 +0100)
When assigning new widget name there needs to be enough place in buffer
to assign name.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250404090337.3564117-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/topology.c

index 3c222c3527016038d3935b219fa3f463d27e9ccc..f2e4ad8b8e1486f37f80cf6a9951a0d8d13e687e 100644 (file)
@@ -1668,8 +1668,8 @@ static int avs_widget_load(struct snd_soc_component *comp, int index,
 
        /* See parse_link_formatted_string() for dynamic naming when(s). */
        if (avs_mach_singular_tdm(mach, ssp_port)) {
-               /* size is based on possible %d -> SSP:TDM, where SSP and TDM < 10 + '\0' */
-               size_t size = strlen(dw->name) + 2;
+               /* size is based on possible %d -> SSP:TDM, where SSP and TDM < 16 + '\0' */
+               size_t size = strlen(dw->name) + 3;
                char *buf;
 
                tdm_slot = avs_mach_ssp_tdm(mach, ssp_port);