diff options
| -rw-r--r-- | fs/proc/thread_self.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/proc/thread_self.c b/fs/proc/thread_self.c index b905010ca9eb..f61ae53533f5 100644 --- a/fs/proc/thread_self.c +++ b/fs/proc/thread_self.c | |||
| @@ -38,6 +38,7 @@ int proc_setup_thread_self(struct super_block *s) | |||
| 38 | struct inode *root_inode = d_inode(s->s_root); | 38 | struct inode *root_inode = d_inode(s->s_root); |
| 39 | struct pid_namespace *ns = proc_pid_ns(root_inode); | 39 | struct pid_namespace *ns = proc_pid_ns(root_inode); |
| 40 | struct dentry *thread_self; | 40 | struct dentry *thread_self; |
| 41 | int ret = -ENOMEM; | ||
| 41 | 42 | ||
| 42 | inode_lock(root_inode); | 43 | inode_lock(root_inode); |
| 43 | thread_self = d_alloc_name(s->s_root, "thread-self"); | 44 | thread_self = d_alloc_name(s->s_root, "thread-self"); |
| @@ -51,20 +52,19 @@ int proc_setup_thread_self(struct super_block *s) | |||
| 51 | inode->i_gid = GLOBAL_ROOT_GID; | 52 | inode->i_gid = GLOBAL_ROOT_GID; |
| 52 | inode->i_op = &proc_thread_self_inode_operations; | 53 | inode->i_op = &proc_thread_self_inode_operations; |
| 53 | d_add(thread_self, inode); | 54 | d_add(thread_self, inode); |
| 55 | ret = 0; | ||
| 54 | } else { | 56 | } else { |
| 55 | dput(thread_self); | 57 | dput(thread_self); |
| 56 | thread_self = ERR_PTR(-ENOMEM); | ||
| 57 | } | 58 | } |
| 58 | } else { | ||
| 59 | thread_self = ERR_PTR(-ENOMEM); | ||
| 60 | } | 59 | } |
| 61 | inode_unlock(root_inode); | 60 | inode_unlock(root_inode); |
| 62 | if (IS_ERR(thread_self)) { | 61 | |
| 62 | if (ret) | ||
| 63 | pr_err("proc_fill_super: can't allocate /proc/thread_self\n"); | 63 | pr_err("proc_fill_super: can't allocate /proc/thread_self\n"); |
| 64 | return PTR_ERR(thread_self); | 64 | else |
| 65 | } | 65 | ns->proc_thread_self = thread_self; |
| 66 | ns->proc_thread_self = thread_self; | 66 | |
| 67 | return 0; | 67 | return ret; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | void __init proc_thread_self_init(void) | 70 | void __init proc_thread_self_init(void) |
