Skip to content

Commit c39524e

Browse files
Dan Carpenteraegl
authored andcommitted
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 <[email protected]> Acked-by: Kees Cook <[email protected]> Signed-off-by: Tony Luck <[email protected]>
1 parent 08b326d commit c39524e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/pstore/inode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,8 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count,
345345

346346
mutex_lock(&root->d_inode->i_mutex);
347347

348-
rc = -ENOSPC;
349348
dentry = d_alloc_name(root, name);
350-
if (IS_ERR(dentry))
349+
if (!dentry)
351350
goto fail_lockedalloc;
352351

353352
memcpy(private->data, data, size);

0 commit comments

Comments
 (0)