Skip to contentSkip to conversation

pstore: d_alloc_name() doesn't return an ERR_PTR

PATCH In review Dan Carpenter 3 participants 3 messages Aug 14, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

fs/pstore/inode.c +1 -2
index 71bf5f4..6a4123d 100644
@@ -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);