Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Linus Torvalds committed Jun 16, 2011
2 parents 99a15e2 + 7939253 commit 8b97b21
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fs/proc/namespaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@ static struct dentry *proc_ns_instantiate(struct inode *dir,
struct inode *inode;
struct proc_inode *ei;
struct dentry *error = ERR_PTR(-ENOENT);
void *ns;

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

ns = ns_ops->get(task);
if (!ns)
goto out_iput;

ei = PROC_I(inode);
inode->i_mode = S_IFREG|S_IRUSR;
inode->i_fop = &ns_file_operations;
ei->ns_ops = ns_ops;
ei->ns = ns_ops->get(task);
if (!ei->ns)
goto out_iput;
ei->ns = ns;

dentry->d_op = &pid_dentry_operations;
d_add(dentry, inode);
Expand Down

0 comments on commit 8b97b21

Please sign in to comment.