sysfs: fix condition check in sysfs_drop_dentry()
authorTejun Heo <htejun@gmail.com>
Mon, 11 Jun 2007 05:03:27 +0000 (14:03 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 12 Jun 2007 23:08:46 +0000 (16:08 -0700)
The condition check doesn't make much sense as it basically always
succeeds.  This causes NULL dereferencing on certain cases.  It seems
that parentheses are put in the wrong place.  Fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/inode.c

index 082e2d430e93389be6343b80397cc236061cd896..38bbe071cc1546cfcecf6ac6ae1a8f5673f9ddb6 100644 (file)
@@ -252,7 +252,7 @@ void sysfs_drop_dentry(struct sysfs_dirent * sd, struct dentry * parent)
        if (dentry) {
                spin_lock(&dcache_lock);
                spin_lock(&dentry->d_lock);
-               if (!(d_unhashed(dentry) && dentry->d_inode)) {
+               if (!d_unhashed(dentry) && dentry->d_inode) {
                        inode = dentry->d_inode;
                        spin_lock(&inode->i_lock);
                        __iget(inode);