[PATCH v3] ASoC: SOF: ipc3-topology: Correct get_control_data for non bytes payload

Péter Ujfalusi peter.ujfalusi at linux.intel.com
Wed Apr 27 20:47:52 CEST 2022



On 27/04/2022 16:20, Sergey Senozhatsky wrote:
> On (22/04/27 22:13), Sergey Senozhatsky wrote:
>>> @@ -784,16 +785,26 @@ static int sof_get_control_data(struct snd_soc_component *scomp,
>>>  		}
>>>  
>>>  		cdata = wdata[i].control->ipc_control_data;
>>> -		wdata[i].pdata = cdata->data;
>>> -		if (!wdata[i].pdata)
>>> -			return -EINVAL;
>>>  
>>>  		/* make sure data is valid - data can be updated at runtime */
>>
>> A silly nit: does this comment belong to SOF_ABI_MAGIC check below?
> 
> I mean something like this?

yes, makes sense. Although I also played with the idea of dropping the
ABI magic check as well, but let's keep it for now.
> 
> ---
>  
>  		cdata = wdata[i].control->ipc_control_data;
>  
> -		/* make sure data is valid - data can be updated at runtime */
>  		if (widget->dobj.widget.kcontrol_type[i] == SND_SOC_TPLG_TYPE_BYTES) {
> +			/*
> +			 * make sure data is valid - data can be updated at
> +			 * runtime
> +			 */
>  			if (cdata->data->magic != SOF_ABI_MAGIC)
>  				return -EINVAL;
>  

-- 
Péter


More information about the Alsa-devel mailing list