summaryrefslogtreecommitdiff
path: root/fs/verity/init.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2023-07-06 00:27:42 +0300
committerEric Biggers <ebiggers@google.com>2023-07-12 08:49:18 +0300
commite77000ccc531088c486fe5fbd13416fd5e3d2714 (patch)
treecc75f2c75caa4054a06635125884bf67210aa066 /fs/verity/init.c
parent5d37a1198068b099de47073411efc087d1b555ca (diff)
downloadlinux-e77000ccc531088c486fe5fbd13416fd5e3d2714.tar.xz
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 <ebiggers@google.com>
Diffstat (limited to 'fs/verity/init.c')
-rw-r--r--fs/verity/init.c24
1 files changed, 3 insertions, 21 deletions
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)