linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wharms@bfs.de (walter harms)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: mach-omap2: potential NULL dereference
Date: Mon, 17 Jan 2011 11:38:45 +0100	[thread overview]
Message-ID: <4D341C35.80506@bfs.de> (raw)
In-Reply-To: <1295258922-31242-1-git-send-email-segoon@openwall.com>



Am 17.01.2011 11:08, schrieb Vasiliy Kulikov:
> kzalloc() may fail, if so return -ENOMEM.
> 
> Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
> ---
>  Cannot compile this driver, so it is not tested at all.
> 
>  arch/arm/mach-omap2/smartreflex.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index 77ecebf..871bca9 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -260,7 +260,10 @@ static int sr_late_init(struct omap_sr *sr_info)
>  	if (sr_class->class_type == SR_CLASS2 &&
>  		sr_class->notify_flags && sr_info->irq) {
>  
> +		ret = -ENOMEM;
>  		name = kzalloc(SMARTREFLEX_NAME_LEN + 1, GFP_KERNEL);
> +		if (name == NULL)
> +			goto error;
>  		strcpy(name, "sr_");
>  		strcat(name, sr_info->voltdm->name);
>  		ret = request_irq(sr_info->irq, sr_interrupt,

maybe it is more readable to use:
	kasprint(&name,"sr_%s",sr_info->voltdm->name);

re,
 wh

  reply	other threads:[~2011-01-17 10:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-17 10:08 [PATCH] arm: mach-omap2: potential NULL dereference Vasiliy Kulikov
2011-01-17 10:38 ` walter harms [this message]
2011-01-19 12:57   ` [PATCH v2] " Vasiliy Kulikov
2011-02-01 22:22     ` Kevin Hilman
2011-01-17 12:30 ` [PATCH] " Sergei Shtylyov
  -- strict thread matches above, loose matches on Subject: below --
2011-01-17 10:08 Vasiliy Kulikov

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=4D341C35.80506@bfs.de \
    --to=wharms@bfs.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).