pstore: d_alloc_name() doesn't return an ERR_PTR
[firefly-linux-kernel-4.4.55.git] / fs / pstore / inode.c
index eaba02d951d3bcafbf36a4b8891bff47ce8e6832..66c8c2fe86b702f1b967f9c5520c9526f5ad0a29 100644 (file)
@@ -336,9 +336,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);