Re: Is a NULL check missing in nfs_lookup?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In message <1167999770.6050.39.camel@xxxxxxxxxxxxxxxxxx>, Trond Myklebust writes:
> On Thu, 2007-01-04 at 19:00 -0500, Chaitanya Patti wrote:
> > 
> > Hello everyone,
> > 
> > In the function nfs_lookup in nfs/dir.c , the following line (line # 926):
> > 
> > error = nfs_reval_fsid(nd->mnt, dir, &fhandle, &fattr);
> > 
> > uses `nd' without having checked if it is NULL.
> > 
> > Is this correct?
> 
> It is quite intentional and correct. Calling ->lookup() without correct
> intent information is a bug.

Ah, ok.  So why not put an ASSERT in there, or at least a comment, to make
the code clearer.  As it stands, anyone looking at the code in the future
can easily rediscover this "bug" that dereferences a null ptr.

Thanks,
Erez.
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux