From e77000ccc531088c486fe5fbd13416fd5e3d2714 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 5 Jul 2023 14:27:42 -0700 Subject: fsverity: simplify handling of errors during initcall Since CONFIG_FS_VERITY is a bool, not a tristate, fs/verity/ can only be builtin or absent entirely; it can't be a loadable module. Therefore, the error code that gets returned from the fsverity_init() initcall is never used. If any part of the initcall does fail, which should never happen, the kernel will be left in a bad state. Following the usual convention for builtin code, just panic the kernel if any of part of the initcall fails. Link: https://lore.kernel.org/r/20230705212743.42180-2-ebiggers@kernel.org Signed-off-by: Eric Biggers --- fs/verity/init.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'fs/verity/init.c') diff --git a/fs/verity/init.c b/fs/verity/init.c index 023905151035..bcd11d63eb1c 100644 --- a/fs/verity/init.c +++ b/fs/verity/init.c @@ -33,28 +33,10 @@ void fsverity_msg(const struct inode *inode, const char *level, static int __init fsverity_init(void) { - int err; - fsverity_check_hash_algs(); - - err = fsverity_init_info_cache(); - if (err) - return err; - - err = fsverity_init_workqueue(); - if (err) - goto err_exit_info_cache; - - err = fsverity_init_signature(); - if (err) - goto err_exit_workqueue; - + fsverity_init_info_cache(); + fsverity_init_workqueue(); + fsverity_init_signature(); return 0; - -err_exit_workqueue: - fsverity_exit_workqueue(); -err_exit_info_cache: - fsverity_exit_info_cache(); - return err; } late_initcall(fsverity_init) -- cgit v1.2.3