diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-08-14 10:55:49 -0700 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2013-08-19 10:13:59 -0700 |
commit | c39524e6744284452ef45480d3153bec28960c32 (patch) | |
tree | 882000ee5c8ed18ce406f803cc8ae039ddd0a227 /fs/pstore | |
parent | 08b326d071534fe5f122d8dec373cacb40bc7a7b (diff) | |
download | op-kernel-dev-c39524e6744284452ef45480d3153bec28960c32.zip op-kernel-dev-c39524e6744284452ef45480d3153bec28960c32.tar.gz |
pstore: d_alloc_name() doesn't return an ERR_PTR
d_alloc_name() returns NULL on error. Also I changed the error code
from -ENOSPC to -ENOMEM to reflect that we were short on RAM not disk
space.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'fs/pstore')
-rw-r--r-- | fs/pstore/inode.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 71bf5f4..6a4123d 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -345,9 +345,8 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count, mutex_lock(&root->d_inode->i_mutex); - rc = -ENOSPC; dentry = d_alloc_name(root, name); - if (IS_ERR(dentry)) + if (!dentry) goto fail_lockedalloc; memcpy(private->data, data, size); |