Whamcloud - gitweb
LU-4629 llite: fix suspicious dereference (merge issue) 73/9273/3
authorDmitry Eremin <dmitry.eremin@intel.com>
Wed, 12 Feb 2014 11:06:34 +0000 (15:06 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 22 Feb 2014 08:08:21 +0000 (08:08 +0000)
Suspicious dereference of pointer 'lfd' before NULL check at line 286

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I64c652279abb8fa1e720d23d645f74f07e5237ca
Reviewed-on: http://review.whamcloud.com/9273
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/dir.c

index c579304..2b1d227 100644 (file)
@@ -273,10 +273,10 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir)
        struct inode            *inode  = filp->f_dentry->d_inode;
        struct ll_file_data     *lfd    = LUSTRE_FPRIVATE(filp);
        struct ll_sb_info       *sbi    = ll_i2sbi(inode);
        struct inode            *inode  = filp->f_dentry->d_inode;
        struct ll_file_data     *lfd    = LUSTRE_FPRIVATE(filp);
        struct ll_sb_info       *sbi    = ll_i2sbi(inode);
-       __u64                   pos     = lfd->lfd_pos;
        int                     hash64  = sbi->ll_flags & LL_SBI_64BIT_HASH;
        int                     api32   = ll_need_32bit_api(sbi);
        struct md_op_data       *op_data;
        int                     hash64  = sbi->ll_flags & LL_SBI_64BIT_HASH;
        int                     api32   = ll_need_32bit_api(sbi);
        struct md_op_data       *op_data;
+       __u64                   pos;
        int                     rc;
 #ifdef HAVE_TOUCH_ATIME_1ARG
        struct path             path;
        int                     rc;
 #ifdef HAVE_TOUCH_ATIME_1ARG
        struct path             path;