Commit a86028f8 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman

staging: most: sound: replace snprintf with strscpy

Using snprintf without a format specifier is potentially risky if
the string device_name contains format specifiers. Replace this with
the safer and more efficient strscpy.

Cleans up clang warning:
drivers/staging/most/sound/sound.c:673:41: warning: format string is not
a string literal (potentially insecure) [-Wformat-security]
Signed-off-by: default avatarColin Ian King <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent d464b7db
......@@ -670,7 +670,7 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
goto err_free_adpt;
pcm->private_data = channel;
snprintf(pcm->name, sizeof(pcm->name), device_name);
strscpy(pcm->name, device_name, sizeof(pcm->name));
snd_pcm_set_ops(pcm, direction, &pcm_ops);
if (create) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment