]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
proc: return -ENOMEM when inode allocation failed
authoryan <clouds.yan@gmail.com>
Wed, 26 Sep 2012 01:34:54 +0000 (11:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Sep 2012 07:28:50 +0000 (17:28 +1000)
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>
fs/proc/generic.c

index b3647fe6a60870e55f36710497fd9dff583963ee..9e8f631643094a4e82c410c3d1ae5194b2dbe8e5 100644 (file)
@@ -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;
                }