[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6da5aeef-40bf-c9bb-fc18-4ac0b3961857@linux.intel.com>
Date: Fri, 2 Aug 2019 10:16:08 -0500
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Vinod Koul <vkoul@...nel.org>
Cc: alsa-devel@...a-project.org, tiwai@...e.de,
gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
broonie@...nel.org, srinivas.kandagatla@...aro.org,
jank@...ence.com, slawomir.blauciak@...el.com,
Sanyog Kale <sanyog.r.kale@...el.com>
Subject: Re: [alsa-devel] [RFC PATCH 06/40] soundwire: intel: prevent possible
dereference in hw_params
On 8/2/19 6:55 AM, Vinod Koul wrote:
> On 25-07-19, 18:39, Pierre-Louis Bossart wrote:
>> This should not happen in production systems but we should test for
>> all callback arguments before invoking the config_stream callback.
>
> so you are saying callback arg is mandatory, if so please document that
> assumption
no, what this says is that if a config_stream is provided then it needs
to have a valid argument.
I am not sure what you mean by "document that assumption", comment in
the code (where?) or SoundWire documentation?
>
>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
>> ---
>> drivers/soundwire/intel.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
>> index 68832e613b1e..497879dd9c0d 100644
>> --- a/drivers/soundwire/intel.c
>> +++ b/drivers/soundwire/intel.c
>> @@ -509,7 +509,7 @@ static int intel_config_stream(struct sdw_intel *sdw,
>> struct snd_soc_dai *dai,
>> struct snd_pcm_hw_params *hw_params, int link_id)
>> {
>> - if (sdw->res->ops && sdw->res->ops->config_stream)
>> + if (sdw->res->ops && sdw->res->ops->config_stream && sdw->res->arg)
>> return sdw->res->ops->config_stream(sdw->res->arg,
>> substream, dai, hw_params, link_id);
>>
>> --
>> 2.20.1
>
Powered by blists - more mailing lists