mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: linux-kernel@vger.kernel.org, greg@kroah.com,
	akpm@linux-foundation.org, cebbert@redhat.com,
	sandeen@redhat.com, maneesh@in.ibm.com, cs@tequila.co.jp
Subject: [PATCH 2/3] sysfs: fix condition check in sysfs_drop_dentry()
Date: Mon, 11 Jun 2007 14:03:27 +0900	[thread overview]
Message-ID: <20070611050327.GL29122@htj.dyndns.org> (raw)
In-Reply-To: <20070611050107.GJ29122@htj.dyndns.org>

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>
---
 fs/sysfs/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: work1/fs/sysfs/inode.c
===================================================================
--- work1.orig/fs/sysfs/inode.c
+++ work1/fs/sysfs/inode.c
@@ -252,7 +252,7 @@ void sysfs_drop_dentry(struct sysfs_dire
 	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);

  parent reply	other threads:[~2007-06-11  5:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11  5:01 [PATCHSET 2.6.22-rc4] sysfs: fix race conditions Tejun Heo
2007-06-11  5:02 ` [PATCH 1/3] sysfs: store sysfs inode nrs in s_ino to avoid readdir oopses Tejun Heo
2007-06-11  5:03 ` Tejun Heo [this message]
2007-06-11  5:04 ` [PATCH 3/3] sysfs: fix race condition around sd->s_dentry, take#2 Tejun Heo
2007-06-11  6:12 ` [PATCHSET 2.6.22-rc4] sysfs: fix race conditions Andrew Morton
2007-06-11  6:15   ` Tejun Heo
2007-06-12  0:54     ` Greg KH
2007-06-12 23:47     ` Greg KH
2007-06-13  4:50       ` Tejun Heo
2007-06-11  9:58 ` Eduard-Gabriel Munteanu
2007-06-11 10:02   ` Tejun Heo
2007-06-11 10:14     ` Eduard-Gabriel Munteanu
2007-06-12 23:21 [GIT PATCH] sysfs fixes for 2.6.22-rc4 Greg KH
2007-06-12 23:22 ` [PATCH 1/3] sysfs: store sysfs inode nrs in s_ino to avoid readdir oopses Greg Kroah-Hartman
2007-06-12 23:22   ` [PATCH 2/3] sysfs: fix condition check in sysfs_drop_dentry() Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070611050327.GL29122@htj.dyndns.org \
    --to=htejun@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cebbert@redhat.com \
    --cc=cs@tequila.co.jp \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.com \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®