Re: [PATCH] ASoC: SOF: topology: fix get control data return type and arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 21, 2019 at 03:32:52PM +0300, Jaska Uimonen wrote:

> +static int sof_get_control_data(struct snd_sof_dev *sdev,
> +				struct snd_soc_dapm_widget *widget,
> +				struct sof_widget_data *wdata,
> +				size_t *size)
>  {
>  	const struct snd_kcontrol_new *kc;
>  	struct soc_mixer_control *sm;
>  	struct soc_bytes_ext *sbe;
>  	struct soc_enum *se;
> -	size_t size = 0;
>  	int i;


> -		size += wdata[i].pdata->size;
> +		/* don't accept 0 size for data */
> +		if (!wdata[i].pdata->size)
> +			return -EINVAL;

This should really be a separate change.

> +
> +		*size += wdata[i].pdata->size;

We appear to be requiring that the size passed in is zero initialized
which is a bit unusual and seems likely to break even if it happens to
work right now.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux