All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] debugfs: Add check for module parameter name
@ 2017-09-21 12:16 Arvind Yadav
  2017-09-21 12:44 ` Al Viro
  0 siblings, 1 reply; 4+ messages in thread
From: Arvind Yadav @ 2017-09-21 12:16 UTC (permalink / raw)
  To: gregkh, viro; +Cc: linux-kernel

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

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

end of thread, other threads:[~2017-09-21 17:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-21 12:16 [PATCH] debugfs: Add check for module parameter name Arvind Yadav
2017-09-21 12:44 ` Al Viro
2017-09-21 16:47   ` arvind
2017-09-21 17:09     ` Al Viro

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.