efivarfs: Return a consistent error when efivarfs_get_inode() fails
authorMatt Fleming <matt.fleming@intel.com>
Tue, 23 Oct 2012 11:41:03 +0000 (12:41 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Tue, 30 Oct 2012 10:39:28 +0000 (10:39 +0000)
Instead of returning -ENOSPC if efivarfs_get_inode() fails we should
be returning -ENOMEM, since running out of memory is the only reason
it can fail.  Furthermore, that's the error value used everywhere else
in this file. It's also less likely to confuse users that hit this
error case.

Acked-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
drivers/firmware/efivars.c

index 6a858d1a5bb308b73b4fe57bb9ea62e5b3f2dd18..58cec627a8214fb58d799303f13f5e576f470844 100644 (file)
@@ -911,7 +911,7 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry,
 
        inode = efivarfs_get_inode(dir->i_sb, dir, mode, 0);
        if (!inode)
-               return -ENOSPC;
+               return -ENOMEM;
 
        var = kzalloc(sizeof(struct efivar_entry), GFP_KERNEL);
        if (!var) {