lkml.org 
[lkml]   [2009]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: shmem_fill_super(): WARNING: kmemcheck: Caught 32-bit read from uninitialized memory
[Ingo Molnar - Sun, Sep 20, 2009 at 07:58:03PM +0200]
...
|
| > [ 0.408000] initcall init_mmap_min_addr+0x0/0x10 returned 0 after 0 usecs
| >
| > Reported-by: Ingo Molnar <mingo@elte.hu>
| > Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
| > ---
| > mm/shmem.c | 5 +----
| > 1 files changed, 1 insertions(+), 4 deletions(-)
| >
| > diff --git a/mm/shmem.c b/mm/shmem.c
| > index d713239..a8f54f3 100644
| > --- a/mm/shmem.c
| > +++ b/mm/shmem.c
| > @@ -2307,17 +2307,14 @@ static int shmem_fill_super(struct super_block *sb,
| > int err = -ENOMEM;
| >
| > /* Round up to L1_CACHE_BYTES to resist false sharing */
| > - sbinfo = kmalloc(max((int)sizeof(struct shmem_sb_info),
| > + sbinfo = kzalloc(max((int)sizeof(struct shmem_sb_info),
| > L1_CACHE_BYTES), GFP_KERNEL);
| > if (!sbinfo)
| > return -ENOMEM;
| >
| > - sbinfo->max_blocks = 0;
| > - sbinfo->max_inodes = 0;
| > sbinfo->mode = S_IRWXUGO | S_ISVTX;
| > sbinfo->uid = current_fsuid();
| > sbinfo->gid = current_fsgid();
| > - sbinfo->mpol = NULL;
| > sb->s_fs_info = sbinfo;
|
| That looks like a step forward even without kmemcheck considered, right?
|
| Ingo

Yeah, and we save a few cpu cycles as well :)

-- Cyrill


\
 
 \ /
  Last update: 2009-09-20 20:07    [W:0.147 / U:0.156 seconds]
©2003-2011 Jasper Spaans