diff options
Diffstat (limited to 'fs/debugfs/inode.c')
-rw-r--r-- | fs/debugfs/inode.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index b486169f42bf..30a87b3dbcac 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/fsnotify.h> | 27 | #include <linux/fsnotify.h> |
28 | #include <linux/string.h> | 28 | #include <linux/string.h> |
29 | #include <linux/magic.h> | 29 | #include <linux/magic.h> |
30 | #include <linux/slab.h> | ||
30 | 31 | ||
31 | static struct vfsmount *debugfs_mount; | 32 | static struct vfsmount *debugfs_mount; |
32 | static int debugfs_mount_count; | 33 | static int debugfs_mount_count; |
@@ -160,15 +161,8 @@ static int debugfs_create_by_name(const char *name, mode_t mode, | |||
160 | * block. A pointer to that is in the struct vfsmount that we | 161 | * block. A pointer to that is in the struct vfsmount that we |
161 | * have around. | 162 | * have around. |
162 | */ | 163 | */ |
163 | if (!parent) { | 164 | if (!parent) |
164 | if (debugfs_mount && debugfs_mount->mnt_sb) { | 165 | parent = debugfs_mount->mnt_sb->s_root; |
165 | parent = debugfs_mount->mnt_sb->s_root; | ||
166 | } | ||
167 | } | ||
168 | if (!parent) { | ||
169 | pr_debug("debugfs: Ah! can not find a parent!\n"); | ||
170 | return -EFAULT; | ||
171 | } | ||
172 | 166 | ||
173 | *dentry = NULL; | 167 | *dentry = NULL; |
174 | mutex_lock(&parent->d_inode->i_mutex); | 168 | mutex_lock(&parent->d_inode->i_mutex); |
@@ -503,7 +497,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, | |||
503 | } | 497 | } |
504 | d_move(old_dentry, dentry); | 498 | d_move(old_dentry, dentry); |
505 | fsnotify_move(old_dir->d_inode, new_dir->d_inode, old_name, | 499 | fsnotify_move(old_dir->d_inode, new_dir->d_inode, old_name, |
506 | old_dentry->d_name.name, S_ISDIR(old_dentry->d_inode->i_mode), | 500 | S_ISDIR(old_dentry->d_inode->i_mode), |
507 | NULL, old_dentry); | 501 | NULL, old_dentry); |
508 | fsnotify_oldname_free(old_name); | 502 | fsnotify_oldname_free(old_name); |
509 | unlock_rename(new_dir, old_dir); | 503 | unlock_rename(new_dir, old_dir); |