diff --git a/sound/soc/sof/utils.c b/sound/soc/sof/utils.c index 93ac71483ef6e0..863c5a1f186250 100644 --- a/sound/soc/sof/utils.c +++ b/sound/soc/sof/utils.c @@ -18,7 +18,6 @@ int sof_bes_setup(struct device *dev, const struct snd_sof_dsp_ops *ops, struct snd_soc_dai_link *links, int link_num, struct snd_soc_card *card) { - char name[32]; int i; if (!ops || !links || !card) @@ -26,8 +25,8 @@ int sof_bes_setup(struct device *dev, const struct snd_sof_dsp_ops *ops, /* set up BE dai_links */ for (i = 0; i < link_num; i++) { - snprintf(name, 32, "NoCodec-%d", i); - links[i].name = devm_kstrdup(dev, name, GFP_KERNEL); + links[i].name = devm_kasprintf(dev, GFP_KERNEL, + "NoCodec-%d", i); if (!links[i].name) return -ENOMEM;