lkml.org 
[lkml]   [2014]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 13/18] staging/lustre/llite: Fix uninitialized variable
    Date
    From: Dmitry Eremin <dmitry.eremin@intel.com>

    'f.f_flags' might be used uninitialized in this function.

    xattr.c:248: 'f.f_flags' is declared.
    xattr.c:244: lump!= ( (void* )0) is true
    xattr.c:254: 'f.f_flags' is used, but is uninitialized.

    Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
    Reviewed-on: http://review.whamcloud.com/10663
    Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
    Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
    Reviewed-by: James Simmons <uja.ornl@gmail.com>
    Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
    ---
    drivers/staging/lustre/lustre/llite/xattr.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c
    index c6c27bb..c1eff65 100644
    --- a/drivers/staging/lustre/lustre/llite/xattr.c
    +++ b/drivers/staging/lustre/lustre/llite/xattr.c
    @@ -246,6 +246,7 @@ int ll_setxattr(struct dentry *dentry, const char *name,
    int lum_size = (lump->lmm_magic == LOV_USER_MAGIC_V1) ?
    sizeof(*lump) : sizeof(struct lov_user_md_v3);

    + memset(&f, 0, sizeof(f)); /* f.f_flags is used below */
    f.f_dentry = dentry;
    rc = ll_lov_setstripe_ea_info(inode, &f, flags, lump,
    lum_size);
    --
    1.9.0


    \
     
     \ /
      Last update: 2014-06-23 05:01    [W:4.288 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site