lkml.org 
[lkml]   [2019]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] debugfs: make return value of all debugfs helpers consistent
Date
Since commit ff9fb72bc077 ("debugfs: return error values, not NULL")
almost all the debugfs helpers have stopped returning NULL. The lone
holdeout was debugfs_create_u32_array(). So fix that.

Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
---
fs/debugfs/file.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index ddd708b09fa1..bb706d073782 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -999,8 +999,8 @@ static const struct file_operations u32_array_fops = {
* Once array is created its size can not be changed.
*
* The function returns a pointer to dentry on success. If an error occurs,
- * %ERR_PTR(-ERROR) or NULL will be returned. If debugfs is not enabled in
- * the kernel, the value %ERR_PTR(-ENODEV) will be returned.
+ * %ERR_PTR(-ERROR) will be returned. If debugfs is not enabled in the kernel,
+ * the value %ERR_PTR(-ENODEV) will be returned.
*/
struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
struct dentry *parent,
@@ -1009,7 +1009,7 @@ struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
struct array_data *data = kmalloc(sizeof(*data), GFP_KERNEL);

if (data == NULL)
- return NULL;
+ return ERR_PTR(-ENOMEM);

data->array = array;
data->elements = elements;
--
2.20.1
\
 
 \ /
  Last update: 2019-04-15 10:25    [W:0.033 / U:12.080 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site