All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] pstore: d_alloc_name() doesn't return an ERR_PTR
@ 2013-08-14 11:52 ` Dan Carpenter
  0 siblings, 0 replies; 5+ 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 related	[flat|nested] 5+ messages in thread

* [patch] pstore: d_alloc_name() doesn't return an ERR_PTR
@ 2013-08-14 11:52 ` Dan Carpenter
  0 siblings, 0 replies; 5+ 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 related	[flat|nested] 5+ messages in thread

* Re: [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
  -1 siblings, 0 replies; 5+ messages in thread
From: Kees Cook @ 2013-08-14 14:25 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Anton Vorontsov, Colin Cross, Tony Luck, LKML, kernel-janitors

On Wed, Aug 14, 2013 at 4:52 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>

Thanks for the catch!

Acked-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] pstore: d_alloc_name() doesn't return an ERR_PTR
@ 2013-08-14 14:25   ` Kees Cook
  0 siblings, 0 replies; 5+ messages in thread
From: Kees Cook @ 2013-08-14 14:25 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Anton Vorontsov, Colin Cross, Tony Luck, LKML, kernel-janitors

On Wed, Aug 14, 2013 at 4:52 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>

Thanks for the catch!

Acked-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [patch] pstore: d_alloc_name() doesn't return an ERR_PTR
  2013-08-14 14:25   ` Kees Cook
  (?)
@ 2013-08-14 17:59   ` Luck, Tony
  -1 siblings, 0 replies; 5+ messages in thread
From: Luck, Tony @ 2013-08-14 17:59 UTC (permalink / raw)
  To: Kees Cook, Dan Carpenter
  Cc: Anton Vorontsov, Colin Cross, LKML, kernel-janitors

>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Thanks for the catch!
>
> Acked-by: Kees Cook <keescook@chromium.org>

Thanks.  Applied.

-Tony

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-14 17:59 UTC | newest]

Thread overview: 5+ 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 11:52 ` Dan Carpenter
2013-08-14 14:25 ` Kees Cook
2013-08-14 14:25   ` Kees Cook
2013-08-14 17:59   ` Luck, Tony

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.