]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
exec: remove checks in __register_bimfmt()
authorAlexey Dobriyan <adobriyan@gmail.com>
Wed, 2 Jun 2021 03:53:15 +0000 (13:53 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 2 Jun 2021 03:53:15 +0000 (13:53 +1000)
Delete NULL check, all callers pass valid pointer.

Delete ->load_binary check -- failure to provide hook in a custom module
will be very noticeable at the very first execve call.

Link: https://lkml.kernel.org/r/YK1Gy1qXaLAR+tPl@localhost.localdomain
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
fs/exec.c

index 18594f11c31fe12e28e80349e7fb1211613e681c..379afcf5d106e2e3973add48ea3c08e8cdda5d6e 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -84,9 +84,6 @@ static DEFINE_RWLOCK(binfmt_lock);
 
 void __register_binfmt(struct linux_binfmt * fmt, int insert)
 {
-       BUG_ON(!fmt);
-       if (WARN_ON(!fmt->load_binary))
-               return;
        write_lock(&binfmt_lock);
        insert ? list_add(&fmt->lh, &formats) :
                 list_add_tail(&fmt->lh, &formats);