Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[PATCH] m32r: Should index be positive?

 
   Soft32 Home -> Linux -> Kernel RSS
Next:  [debian-hurd-Patches][312040] man-db 2.6.5  
Author Message
Roel Kluin

External


Since: Dec 02, 2008
Posts: 52



(Msg. 1) Posted: Sun Nov 01, 2009 9:20 am
Post subject: [PATCH] m32r: Should index be positive?
Archived from groups: linux>kernel (more info?)

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 DeleteThis @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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo DeleteThis @vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Hirokazu Takata

External


Since: Sep 12, 2005
Posts: 25



(Msg. 2) Posted: Tue Nov 03, 2009 7:20 pm
Post subject: Re: [PATCH] m32r: Should index be positive? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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.RemoveThis@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.RemoveThis@linux-m32r.org>

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

Thank you.

-- Takata
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.RemoveThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Display posts from previous:   
Related Topics:
i8042 lockdep false positive. - I just had a user file the report below, which iirc, was deemed a false positive. Didn't we add something to the code....

checkpatch.pl false positive on exported pointers - WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #563: FILE:..

[PATCH] no USB on M32R - Won't build due to lack of dma-mapping. Shouldn't that dependency (having PCMCIA => HCD possible) be on CARDBUS,..

[PATCH] markers-linker-m32r - Add EXTRA_RWDATA to m32r. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> ---..

[PATCH] [m32r] __xchg() should be always_inline - it depends on elimination of unreachable branches in switch (by object size), so we must declare it always_inline ..

[PATCH] m32r: class_device -> device fallout - Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> --- drivers/pcmcia/m32r_pcc.c | 2 +- 1 files changed, 1..
       Soft32 Home -> Linux -> Kernel All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]