forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 140
Closed
Description
Feedback from @andy-shev
> +int sof_bes_setup(struct device *dev, 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)
> + return -EINVAL;
> +
> + /* set up BE dai_links */
> + for (i = 0; i < link_num; i++) {
> + snprintf(name, 32, "NoCodec-%d", i);
sizeof(name) ?
> + links[i].name = devm_kstrdup(dev, name, GFP_KERNEL);
> + if (!links[i].name)
> + return -ENOMEM;
...or better devm_kasprintf().
I always get things wrong with strings so better have someone deal with this...