提交 c39524e6 编写于 作者: D Dan Carpenter 提交者: Tony Luck

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: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NKees Cook <keescook@chromium.org>
Signed-off-by: NTony Luck <tony.luck@intel.com>
上级 08b326d0
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册