-----Original Message----- From: Mark Brown [mailto:broonie@kernel.org] Sent: Wednesday, August 21, 2019 4:00 PM To: Jaska Uimonen jaska.uimonen@linux.intel.com Cc: alsa-devel@alsa-project.org; Uimonen, Jaska jaska.uimonen@intel.com Subject: Re: [PATCH] ASoC: SOF: topology: fix get control data return type and arguments
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.
[Uimonen, Jaska] Ok will remove from this patch.
*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.
[Uimonen, Jaska] Same comments I got from Pierre, obviously I'm not very good listener. Will initialize size to 0. --------------------------------------------------------------------- Intel Finland Oy Registered Address: PL 281, 00181 Helsinki Business Identity Code: 0357606 - 4 Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.