Skip to content
Commit ff9fb72b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

debugfs: return error values, not NULL



When an error happens, debugfs should return an error pointer value, not
NULL.  This will prevent the totally theoretical error where a debugfs
call fails due to lack of memory, returning NULL, and that dentry value
is then passed to another debugfs call, which would end up succeeding,
creating a file at the root of the debugfs tree, but would then be
impossible to remove (because you can not remove the directory NULL).

So, to make everyone happy, always return errors, this makes the users
of debugfs much simpler (they do not have to ever check the return
value), and everyone can rest easy.

Reported-by: default avatarGary R Hook <ghook@amd.com>
Reported-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Reported-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Reported-by: default avatarMichal Hocko <mhocko@kernel.org>
Reported-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Reported-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d88c93f0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment