Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9e15f25 authored by Greg KH's avatar Greg KH Committed by Greg Kroah-Hartman
Browse files

debugfs: allow bad parent pointers to be passed in



If something went wrong with creating a debugfs file/symlink/directory,
that value could be passed down into debugfs again as a parent dentry.
To make caller code simpler, just error out if this happens, and don't
crash the kernel.

Reported-by: default avatarAlex Elder <elder@linaro.org>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
parent fdc81b79
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -254,6 +254,9 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)

	pr_debug("debugfs: creating file '%s'\n",name);

	if (IS_ERR(parent))
		return parent;

	error = simple_pin_fs(&debug_fs_type, &debugfs_mount,
			      &debugfs_mount_count);
	if (error)