lkml.org 
[lkml]   [2020]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/5] soundwire: intel: add sdw_stream_setup helper for .startup callback
On 14-01-20, 17:42, Pierre-Louis Bossart wrote:
> From: Rander Wang <rander.wang@linux.intel.com>
>
> The sdw stream is allocated and stored in dai to share the sdw runtime
> information.
>
> Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
> drivers/soundwire/intel.c | 64 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 64 insertions(+)
>
> diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
> index 999aa2cd9fea..c498812522ab 100644
> --- a/drivers/soundwire/intel.c
> +++ b/drivers/soundwire/intel.c
> @@ -617,6 +617,68 @@ static int intel_post_bank_switch(struct sdw_bus *bus)
> * DAI routines
> */
>
> +static int sdw_stream_setup(struct snd_pcm_substream *substream,
> + struct snd_soc_dai *dai)
> +{
> + struct snd_soc_pcm_runtime *rtd = substream->private_data;
> + struct sdw_stream_runtime *sdw_stream = NULL;
> + char *name;
> + int i, ret;
> +
> + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
> + name = kasprintf(GFP_KERNEL, "%s-Playback", dai->name);
> + else
> + name = kasprintf(GFP_KERNEL, "%s-Capture", dai->name);

I don't see name being feed on success. It is nicely freed on error but on
success it should be freed when you close

--
~Vinod

\
 
 \ /
  Last update: 2020-02-12 11:13    [W:0.116 / U:2.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site