فهرست منبع

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 <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tejun Heo 18 سال پیش
والد
کامیت
6aa054aadf
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      fs/sysfs/inode.c

+ 1 - 1
fs/sysfs/inode.c

@@ -252,7 +252,7 @@ void sysfs_drop_dentry(struct sysfs_dirent * sd, struct dentry * parent)
 	if (dentry) {
 	if (dentry) {
 		spin_lock(&dcache_lock);
 		spin_lock(&dcache_lock);
 		spin_lock(&dentry->d_lock);
 		spin_lock(&dentry->d_lock);
-		if (!(d_unhashed(dentry) && dentry->d_inode)) {
+		if (!d_unhashed(dentry) && dentry->d_inode) {
 			inode = dentry->d_inode;
 			inode = dentry->d_inode;
 			spin_lock(&inode->i_lock);
 			spin_lock(&inode->i_lock);
 			__iget(inode);
 			__iget(inode);