All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: Vishal Thanki <vishalthanki@gmail.com>
Cc: kernel-janitors@vger.kernel.org, alsa-devel@alsa-project.org,
	broonie@kernel.org, lgirdwood@gmail.com
Subject: Re: [PATCH] ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of
Date: Wed, 04 Mar 2015 21:29:55 +0100	[thread overview]
Message-ID: <54F76B43.3030602@bfs.de> (raw)
In-Reply-To: <20150303132900.GA22246@vishal>



Am 03.03.2015 14:29, schrieb Vishal Thanki:
> Make sure devm_kzalloc() succeeds.
> 
> Signed-off-by: Vishal Thanki <vishalthanki@gmail.com>
> ---
>  sound/soc/generic/simple-card.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
> index f7c6734..fb550b5 100644
> --- a/sound/soc/generic/simple-card.c
> +++ b/sound/soc/generic/simple-card.c
> @@ -372,6 +372,11 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
>  			    strlen(dai_link->cpu_dai_name)   +
>  			    strlen(dai_link->codec_dai_name) + 2,
>  			    GFP_KERNEL);
> +	if (!name) {
> +		ret = -ENOMEM;
> +		goto dai_link_of_err;
> +	}
> +
>  	sprintf(name, "%s-%s", dai_link->cpu_dai_name,
>  				dai_link->codec_dai_name);
>  	dai_link->name = dai_link->stream_name = name;


maybe it is more simple to use kasprintf here ?

just my 2 cents,
wh


WARNING: multiple messages have this Message-ID (diff)
From: walter harms <wharms@bfs.de>
To: Vishal Thanki <vishalthanki@gmail.com>
Cc: kernel-janitors@vger.kernel.org, alsa-devel@alsa-project.org,
	broonie@kernel.org, lgirdwood@gmail.com
Subject: Re: [PATCH] ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of
Date: Wed, 04 Mar 2015 20:29:55 +0000	[thread overview]
Message-ID: <54F76B43.3030602@bfs.de> (raw)
In-Reply-To: <20150303132900.GA22246@vishal>



Am 03.03.2015 14:29, schrieb Vishal Thanki:
> Make sure devm_kzalloc() succeeds.
> 
> Signed-off-by: Vishal Thanki <vishalthanki@gmail.com>
> ---
>  sound/soc/generic/simple-card.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
> index f7c6734..fb550b5 100644
> --- a/sound/soc/generic/simple-card.c
> +++ b/sound/soc/generic/simple-card.c
> @@ -372,6 +372,11 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
>  			    strlen(dai_link->cpu_dai_name)   +
>  			    strlen(dai_link->codec_dai_name) + 2,
>  			    GFP_KERNEL);
> +	if (!name) {
> +		ret = -ENOMEM;
> +		goto dai_link_of_err;
> +	}
> +
>  	sprintf(name, "%s-%s", dai_link->cpu_dai_name,
>  				dai_link->codec_dai_name);
>  	dai_link->name = dai_link->stream_name = name;


maybe it is more simple to use kasprintf here ?

just my 2 cents,
wh


  parent reply	other threads:[~2015-03-04 20:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 13:29 [PATCH] ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of Vishal Thanki
2015-03-03 13:41 ` Vishal Thanki
2015-03-03 14:25 ` Mark Brown
2015-03-03 14:25   ` Mark Brown
2015-03-04 20:29 ` walter harms [this message]
2015-03-04 20:29   ` walter harms
2015-03-05 10:45   ` Vishal Thanki
2015-03-05 12:03     ` [alsa-devel] " Lars-Peter Clausen
2015-03-05 12:03       ` Lars-Peter Clausen
2015-03-05 19:35       ` walter harms
2015-03-05 19:35         ` walter harms
  -- strict thread matches above, loose matches on Subject: below --
2015-03-03 13:14 Vishal Thanki
2015-03-03 13:18 ` [alsa-devel] " Lars-Peter Clausen
2015-03-03 13:18   ` Lars-Peter Clausen

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=54F76B43.3030602@bfs.de \
    --to=wharms@bfs.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=vishalthanki@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.