Skip to content

Commit 8b97b21

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd
* git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd: proc: Fix Oops on stat of /proc/<zombie pid>/ns/net
2 parents 99a15e2 + 7939253 commit 8b97b21

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fs/proc/namespaces.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,21 @@ static struct dentry *proc_ns_instantiate(struct inode *dir,
3838
struct inode *inode;
3939
struct proc_inode *ei;
4040
struct dentry *error = ERR_PTR(-ENOENT);
41+
void *ns;
4142

4243
inode = proc_pid_make_inode(dir->i_sb, task);
4344
if (!inode)
4445
goto out;
4546

47+
ns = ns_ops->get(task);
48+
if (!ns)
49+
goto out_iput;
50+
4651
ei = PROC_I(inode);
4752
inode->i_mode = S_IFREG|S_IRUSR;
4853
inode->i_fop = &ns_file_operations;
4954
ei->ns_ops = ns_ops;
50-
ei->ns = ns_ops->get(task);
51-
if (!ei->ns)
52-
goto out_iput;
55+
ei->ns = ns;
5356

5457
dentry->d_op = &pid_dentry_operations;
5558
d_add(dentry, inode);

0 commit comments

Comments
 (0)