From: Matt Fleming Date: Tue, 23 Oct 2012 11:41:03 +0000 (+0100) Subject: efivarfs: Return a consistent error when efivarfs_get_inode() fails X-Git-Tag: v3.8-rc1~110^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aeeaa8d46aa38c9cc5fac23feb9b1f91bdbf5dd3;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git efivarfs: Return a consistent error when efivarfs_get_inode() fails 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 Signed-off-by: Matt Fleming --- diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 6a858d1..58cec62 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c @@ -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) {