Skip to content

Commit

Permalink
efivarfs: Return a consistent error when efivarfs_get_inode() fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matt Fleming committed Oct 30, 2012
1 parent 07b1c5b commit aeeaa8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/firmware/efivars.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit aeeaa8d

Please sign in to comment.