Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d9307dabb3de8140fb3801bf6eb01f231dbd83d
Commit:     9d9307dabb3de8140fb3801bf6eb01f231dbd83d
Parent:     0c73f18b7d95de8a007039337063a770b5fc8e7a
Author:     Rafael J. Wysocki <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 14 03:45:18 2007 +0900
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Wed Jul 11 16:09:07 2007 -0700

    sysfs: Fix oops in sysfs_drop_dentry on x86_64
    
    Fix oops on x86_64 caused by the dereference of dir in
    sysfs_drop_dentry() made before checking if dir is not NULL
    (cf. http://marc.info/?l=linux-kernel&m=118151626704924&w=2).
    
    Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/inode.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 732fd7f..ee31bf3 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -285,7 +285,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd)
 int sysfs_hash_and_remove(struct dentry * dir, const char * name)
 {
        struct sysfs_dirent **pos, *sd;
-       struct sysfs_dirent *parent_sd = dir->d_fsdata;
+       struct sysfs_dirent *parent_sd;
        int found = 0;
 
        if (!dir)
@@ -295,6 +295,7 @@ int sysfs_hash_and_remove(struct dentry * dir, const char * 
name)
                /* no inode means this hasn't been made visible yet */
                return -ENOENT;
 
+       parent_sd = dir->d_fsdata;
        mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
        for (pos = &parent_sd->s_children; *pos; pos = &(*pos)->s_sibling) {
                sd = *pos;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to