* [patch] pstore: d_alloc_name() doesn't return an ERR_PTR
@ 2013-08-14 11:52 Dan Carpenter
2013-08-14 14:25 ` Kees Cook
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2013-08-14 11:52 UTC (permalink / raw)
To: Anton Vorontsov
Cc: Colin Cross, Kees Cook, Tony Luck, linux-kernel, kernel-janitors
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>
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);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-14 17:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-14 11:52 [patch] pstore: d_alloc_name() doesn't return an ERR_PTR Dan Carpenter
2013-08-14 14:25 ` Kees Cook
2013-08-14 17:59 ` Luck, Tony
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome