[PATCH] ALSA: ump: Use safe_append_string() in snd_ump_update_group_attrs()

From: Thorsten Blum

Date: Thu Oct 22 2026 - 04:28:59 EST


To prepare for removing strlcat() from the kernel [1], use the existing
safe_append_string() helper to append the group name separator.

No functional change.

Link: https://github.com/KSPP/linux/issues/370 [1]
Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
sound/core/ump.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/core/ump.c b/sound/core/ump.c
index 3d1a2ed3b476..18780dece1a8 100644
--- a/sound/core/ump.c
+++ b/sound/core/ump.c
@@ -559,6 +559,7 @@ static void snd_ump_proc_read(struct snd_info_entry *entry,
/* update dir_bits and active flag for all groups in the client */
void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump)
{
+ static const char separator[] = ", ";
struct snd_ump_block *fb;
struct snd_ump_group *group;
int i;
@@ -598,7 +599,8 @@ void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump)
if (!*fb->info.name)
continue;
if (*group->name)
- strlcat(group->name, ", ", sizeof(group->name));
+ safe_append_string(group->name, sizeof(group->name),
+ separator, sizeof(separator));
safe_append_string(group->name, sizeof(group->name),
fb->info.name, sizeof(fb->info.name));
}