diff options
Diffstat (limited to 'fs/proc/namespaces.c')
-rw-r--r-- | fs/proc/namespaces.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c index 781dec5bd682..be177f702acb 100644 --- a/fs/proc/namespaces.c +++ b/fs/proc/namespaces.c | |||
@@ -38,18 +38,21 @@ static struct dentry *proc_ns_instantiate(struct inode *dir, | |||
38 | struct inode *inode; | 38 | struct inode *inode; |
39 | struct proc_inode *ei; | 39 | struct proc_inode *ei; |
40 | struct dentry *error = ERR_PTR(-ENOENT); | 40 | struct dentry *error = ERR_PTR(-ENOENT); |
41 | void *ns; | ||
41 | 42 | ||
42 | inode = proc_pid_make_inode(dir->i_sb, task); | 43 | inode = proc_pid_make_inode(dir->i_sb, task); |
43 | if (!inode) | 44 | if (!inode) |
44 | goto out; | 45 | goto out; |
45 | 46 | ||
47 | ns = ns_ops->get(task); | ||
48 | if (!ns) | ||
49 | goto out_iput; | ||
50 | |||
46 | ei = PROC_I(inode); | 51 | ei = PROC_I(inode); |
47 | inode->i_mode = S_IFREG|S_IRUSR; | 52 | inode->i_mode = S_IFREG|S_IRUSR; |
48 | inode->i_fop = &ns_file_operations; | 53 | inode->i_fop = &ns_file_operations; |
49 | ei->ns_ops = ns_ops; | 54 | ei->ns_ops = ns_ops; |
50 | ei->ns = ns_ops->get(task); | 55 | ei->ns = ns; |
51 | if (!ei->ns) | ||
52 | goto out_iput; | ||
53 | 56 | ||
54 | dentry->d_op = &pid_dentry_operations; | 57 | dentry->d_op = &pid_dentry_operations; |
55 | d_add(dentry, inode); | 58 | d_add(dentry, inode); |