mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hirokazu Takata <takata@linux-m32r.org>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>,
	linux-m32r@ml.linux-m32r.org,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] m32r: Should index be positive?
Date: Wed, 04 Nov 2009 09:14:07 +0900	[thread overview]
Message-ID: <swf7hu7i1tc.wl%takata@linux-m32r.org> (raw)
In-Reply-To: <4AED9C22.3040301@gmail.com>

At Sun, 01 Nov 2009 15:33:06 +0100,
Roel Kluin wrote:
> 
> Index `ipi_num' is signed, test whether it is negative to
> make sure we don't get a negative array element.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
>  arch/m32r/kernel/smp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> Found by code analysis, is it required?
> 
> diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c
> index 8a88f1f..31cef20 100644
> --- a/arch/m32r/kernel/smp.c
> +++ b/arch/m32r/kernel/smp.c
> @@ -806,7 +806,7 @@ unsigned long send_IPI_mask_phys(cpumask_t physid_mask, int ipi_num,
>  
>  	if (mask & ~physids_coerce(phys_cpu_present_map))
>  		BUG();
> -	if (ipi_num >= NR_IPIS)
> +	if (ipi_num >= NR_IPIS || ipi_num < 0)
>  		BUG();
>  
>  	mask <<= IPI_SHIFT;
> 

Acked-by: Hirokazu Takata <takata@linux-m32r.org>

It looks OK for me.
I've merged this patch into my tree.

Thank you.

-- Takata

      reply	other threads:[~2009-11-04  0:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-01 14:33 Roel Kluin
2009-11-04  0:14 ` Hirokazu Takata [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=swf7hu7i1tc.wl%takata@linux-m32r.org \
    --to=takata@linux-m32r.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m32r@ml.linux-m32r.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

all inboxes | Powered by JetHome®