public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* A potential bug in mm/memblock.c?
@ 2012-04-25  6:27 Peter Teoh
  2012-04-25  7:16 ` Minchan Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Teoh @ 2012-04-25  6:27 UTC (permalink / raw)
  To: LKML; +Cc: Minchan Kim

Comments please.   Thanks.

Signed-off-by: Peter Teoh <htmldeveloper@gmail.com>

diff --git a/mm/memblock.c b/mm/memblock.c
index a44eab3..2c621c5 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -553,8 +553,8 @@ void __init_memblock __next_free_mem_range(u64
*idx, int nid,
 {
       struct memblock_type *mem = &memblock.memory;
       struct memblock_type *rsv = &memblock.reserved;
-       int mi = *idx & 0xffffffff;
-       int ri = *idx >> 32;
+       unsigned int mi = *idx & 0xffffffff;
+       unsigned int ri = *idx >> 32;

       for ( ; mi < mem->cnt; mi++) {
               struct memblock_region *m = &mem->regions[mi];



-- 
Regards,
Peter Teoh

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: A potential bug in mm/memblock.c?
  2012-04-25  6:27 A potential bug in mm/memblock.c? Peter Teoh
@ 2012-04-25  7:16 ` Minchan Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Minchan Kim @ 2012-04-25  7:16 UTC (permalink / raw)
  To: Peter Teoh; +Cc: LKML, Minchan Kim

On 04/25/2012 03:27 PM, Peter Teoh wrote:

> Comments please.   Thanks.


barrios@bbox:~/linux-next$ ./scripts/get_maintainer.pl -f mm/memblock.c
Tejun Heo <tj@kernel.org> (commit_signer:32/36=89%)
"H. Peter Anvin" <hpa@linux.intel.com> (commit_signer:15/36=42%)
Andrew Morton <akpm@linux-foundation.org> (commit_signer:4/36=11%)
Ingo Molnar <mingo@elte.hu> (commit_signer:2/36=6%)
linux-mm@kvack.org (open list:MEMORY MANAGEMENT)
linux-kernel@vger.kernel.org (open list)

Please Cced them and write down the description which should include
problem and how to fix. And it would be better to use more clear subject.

[BUG]memblock: fix overflow of array index

Anyway,

Reviewed-by: Minchan Kim <minchan@kernel.org>

> 
> Signed-off-by: Peter Teoh <htmldeveloper@gmail.com>
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index a44eab3..2c621c5 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -553,8 +553,8 @@ void __init_memblock __next_free_mem_range(u64
> *idx, int nid,
>  {
>        struct memblock_type *mem = &memblock.memory;
>        struct memblock_type *rsv = &memblock.reserved;
> -       int mi = *idx & 0xffffffff;
> -       int ri = *idx >> 32;
> +       unsigned int mi = *idx & 0xffffffff;
> +       unsigned int ri = *idx >> 32;
> 
>        for ( ; mi < mem->cnt; mi++) {
>                struct memblock_region *m = &mem->regions[mi];
> 
> 
> 



-- 
Kind regards,
Minchan Kim

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-25  7:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-25  6:27 A potential bug in mm/memblock.c? Peter Teoh
2012-04-25  7:16 ` Minchan Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox