From b80c1c9633ef1a29f38bde6b54c72b7a21112bae Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 11 Jun 2007 14:03:27 +0900 Subject: [PATCH] sysfs: fix condition check in sysfs_drop_dentry() 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 Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 082e2d430e933..38bbe071cc154 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -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); -- 2.39.5