lkml.org 
[lkml]   [2017]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] debugfs: Add check for module parameter name
Date
Here, start_creating() is calling by debugfs_create_dir()
and debugfs_create_automount(). driver can pass name as NULL in
debugfs_create_dir and debugfs_create_automount. So we need to
add check for 'name'.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
fs/debugfs/inode.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index c59f015..aa5988d 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -292,6 +292,9 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
if (IS_ERR(parent))
return parent;

+ if (!name)
+ return ERR_PTR(-ENOMEM);
+
error = simple_pin_fs(&debug_fs_type, &debugfs_mount,
&debugfs_mount_count);
if (error)
--
1.9.1
\
 
 \ /
  Last update: 2017-09-21 19:32    [W:0.043 / U:5.944 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site