Skip to content

Commit

Permalink
proc: return -ENOMEM when inode allocation failed
Browse files Browse the repository at this point in the history
If proc_get_inode() returns NULL then presumably it encountered memory
exhaustion.  proc_lookup_de() should return -ENOMEM in this case, not
-EINVAL.

Signed-off-by: yan <clouds.yan@gmail.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
yan authored and Linus Torvalds committed Oct 5, 2012
1 parent 2aa362c commit 6207275
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/proc/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir,
if (!memcmp(dentry->d_name.name, de->name, de->namelen)) {
pde_get(de);
spin_unlock(&proc_subdir_lock);
error = -EINVAL;
error = -ENOMEM;
inode = proc_get_inode(dir->i_sb, de);
goto out_unlock;
}
Expand Down

0 comments on commit 6207275

Please sign in to comment.