* [PATCH] m32r: Should index be positive?
@ 2009-11-01 14:33 Roel Kluin
2009-11-04 0:14 ` Hirokazu Takata
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-11-01 14:33 UTC (permalink / raw)
To: Hirokazu Takata, linux-m32r, Andrew Morton, LKML
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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] m32r: Should index be positive?
2009-11-01 14:33 [PATCH] m32r: Should index be positive? Roel Kluin
@ 2009-11-04 0:14 ` Hirokazu Takata
0 siblings, 0 replies; 2+ messages in thread
From: Hirokazu Takata @ 2009-11-04 0:14 UTC (permalink / raw)
To: Roel Kluin; +Cc: Hirokazu Takata, linux-m32r, Andrew Morton, LKML
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-04 0:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-01 14:33 [PATCH] m32r: Should index be positive? Roel Kluin
2009-11-04 0:14 ` Hirokazu Takata
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox