mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Kangjie Lu <kjlu@umn.edu>
Cc: pakki001@umn.edu, Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Jie Yang <yang.jie@linux.intel.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sound: atom: fix a missing check of snd_pcm_lib_malloc_pages
Date: Wed, 26 Dec 2018 11:57:47 -0600	[thread overview]
Message-ID: <a684ebcb-7b7a-d5b5-8770-f87db0c5a480@linux.intel.com> (raw)
In-Reply-To: <20181226022950.71824-1-kjlu@umn.edu>


On 12/25/18 8:29 PM, Kangjie Lu wrote:
> snd_pcm_lib_malloc_pages() may fail, so let's check its status and
> return its error code upstream.

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>


>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
>   sound/soc/intel/atom/sst-mfld-platform-pcm.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> index afc559866095..91a2436ce952 100644
> --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> @@ -399,7 +399,13 @@ static int sst_media_hw_params(struct snd_pcm_substream *substream,
>   				struct snd_pcm_hw_params *params,
>   				struct snd_soc_dai *dai)
>   {
> -	snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
> +	int ret;
> +
> +	ret =
> +		snd_pcm_lib_malloc_pages(substream,
> +				params_buffer_bytes(params));
> +	if (ret)
> +		return ret;
>   	memset(substream->runtime->dma_area, 0, params_buffer_bytes(params));
>   	return 0;
>   }

  reply	other threads:[~2018-12-26 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-26  2:29 Kangjie Lu
2018-12-26 17:57 ` Pierre-Louis Bossart [this message]
2019-01-01  8:34   ` Takashi Iwai
2019-01-07 18:10 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a684ebcb-7b7a-d5b5-8770-f87db0c5a480@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kjlu@umn.edu \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=yang.jie@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®