Skip to content

Upstream: Patch 14/14: simplify utils #426

@plbossart

Description

@plbossart

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...

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions