fault-inject: clean up debugfs file creation logic
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Jun 2019 09:58:28 +0000 (11:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Jun 2019 11:47:24 +0000 (13:47 +0200)
commit053cf51040ed0ebc56c1b58453ad502dc4d0927b
tree40e8117708017d79d93c2093ccef4b0165d8c269
parent9fd714cd7f4676e8ff3f840911a8d64cacbeab8b
fault-inject: clean up debugfs file creation logic

There is no need to check the return value of a debugfs_create_file
call, a caller should never change what they do depending on if debugfs
is working properly or not, so remove the checks, simplifying the logic
in the file a lot.

Also fix up the error check for debugfs_create_dir() which was not
returning NULL for an error, but rather a error pointer.

Cc: linux-kernel@vger.kernel.org
Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/fault-inject.c