lkml.org 
[lkml]   [2013]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] 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 <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);

\
 
 \ /
  Last update: 2013-08-14 14:41    [W:0.033 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site