public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] OMAP: Should cs be positive in gpmc_cs_free()?
Date: Tue, 3 Nov 2009 09:05:40 -0800	[thread overview]
Message-ID: <20091103170540.GH8981@atomide.com> (raw)
In-Reply-To: <4AED8A98.6040205@gmail.com>

* Roel Kluin <roel.kluin@gmail.com> [091101 05:07]:
> The index `cs' is signed, test whether it is negative before
> we release gpmc_cs_mem[cs].
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> Found by code analysis, is it required?

Looks like a valid check to me.

Acked-by: Tony Lindgren <tony@atomide.com>

> 
> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
> index 1587682..c892a54 100644
> --- a/arch/arm/mach-omap2/gpmc.c
> +++ b/arch/arm/mach-omap2/gpmc.c
> @@ -378,7 +378,7 @@ EXPORT_SYMBOL(gpmc_cs_request);
>  void gpmc_cs_free(int cs)
>  {
>  	spin_lock(&gpmc_mem_lock);
> -	if (cs >= GPMC_CS_NUM || !gpmc_cs_reserved(cs)) {
> +	if (cs >= GPMC_CS_NUM || cs < 0 || !gpmc_cs_reserved(cs)) {
>  		printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs);
>  		BUG();
>  		spin_unlock(&gpmc_mem_lock);

      reply	other threads:[~2009-11-03 17:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-01 13:18 [PATCH] OMAP: Should cs be positive in gpmc_cs_free()? Roel Kluin
2009-11-03 17:05 ` Tony Lindgren [this message]

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=20091103170540.GH8981@atomide.com \
    --to=tony@atomide.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=roel.kluin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox