]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
exit: Rename module_put_and_exit to module_put_and_kthread_exit
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 3 Dec 2021 17:00:19 +0000 (11:00 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:18:55 +0000 (16:18 +0200)
[ Upstream commit ca3574bd653aba234a4b31955f2778947403be16 ]

Update module_put_and_exit to call kthread_exit instead of do_exit.

Change the name to reflect this change in functionality.  All of the
users of module_put_and_exit are causing the current kthread to exit
so this change makes it clear what is happening.  There is no
functional change.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
crypto/algboss.c
fs/cifs/connect.c
fs/nfs/callback.c
fs/nfs/nfs4state.c
fs/nfsd/nfssvc.c
include/linux/module.h
kernel/module.c
net/bluetooth/bnep/core.c
net/bluetooth/cmtp/core.c
net/bluetooth/hidp/core.c
tools/objtool/check.c

index 1814d2c5188a31ef1db46f6ea5e1cbfc1f303f27..eb5fe84efb83e69cba4335f896b6a8f740630de2 100644 (file)
@@ -67,7 +67,7 @@ out:
        complete_all(&param->larval->completion);
        crypto_alg_put(&param->larval->alg);
        kfree(param);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
 }
 
 static int cryptomgr_schedule_probe(struct crypto_larval *larval)
@@ -190,7 +190,7 @@ skiptest:
        crypto_alg_tested(param->driver, err);
 
        kfree(param);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
 }
 
 static int cryptomgr_schedule_test(struct crypto_alg *alg)
index a3e4811b7871eec4f0b735e7602d1822aaca7bfa..1cbfb74c53804a1d4bdbceaee0eee34b0f66d22b 100644 (file)
@@ -1145,7 +1145,7 @@ next_pdu:
        }
 
        memalloc_noreclaim_restore(noreclaim_flag);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
 }
 
 /*
index 86d856de1389b18583f5db9842be133c6a19a6a0..3c86a559a321ae6e006f66957220e51a82d52f64 100644 (file)
@@ -93,7 +93,7 @@ nfs4_callback_svc(void *vrqstp)
                svc_process(rqstp);
        }
        svc_exit_thread(rqstp);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
@@ -137,7 +137,7 @@ nfs41_callback_svc(void *vrqstp)
                }
        }
        svc_exit_thread(rqstp);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
index 258e6b167285c0072c8a6fb7fdbd47d80c8d1c7a..d7868cc52780562c2b22316347aa78efcf64dc2e 100644 (file)
@@ -2766,6 +2766,6 @@ again:
                goto again;
 
        nfs_put_client(clp);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
index 408cff8fe32d39766627425b340eb014370d2aff..0f84151011088d8d37b883e92699370e83889817 100644 (file)
@@ -986,7 +986,7 @@ out:
 
        /* Release module */
        mutex_unlock(&nfsd_mutex);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
index 701c150485b2f4eb02522d0cb5955a566f3886bb..fb9762e16f2858e070773893495ffbbefa50e7d4 100644 (file)
@@ -595,9 +595,9 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
 /* Look for this name: can be of form module:name. */
 unsigned long module_kallsyms_lookup_name(const char *name);
 
-extern void __noreturn __module_put_and_exit(struct module *mod,
+extern void __noreturn __module_put_and_kthread_exit(struct module *mod,
                        long code);
-#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code)
+#define module_put_and_kthread_exit(code) __module_put_and_kthread_exit(THIS_MODULE, code)
 
 #ifdef CONFIG_MODULE_UNLOAD
 int module_refcount(struct module *mod);
@@ -790,7 +790,7 @@ static inline int unregister_module_notifier(struct notifier_block *nb)
        return 0;
 }
 
-#define module_put_and_exit(code) do_exit(code)
+#define module_put_and_kthread_exit(code) kthread_exit(code)
 
 static inline void print_modules(void)
 {
index 4d49c32af570c804c5bb9c4ed562dedbc7d0d420..f2b8314546f177137f5edf58e27e119dcbbf4947 100644 (file)
@@ -337,12 +337,12 @@ static inline void add_taint_module(struct module *mod, unsigned flag,
  * A thread that wants to hold a reference to a module only while it
  * is running can call this to safely exit.  nfsd and lockd use this.
  */
-void __noreturn __module_put_and_exit(struct module *mod, long code)
+void __noreturn __module_put_and_kthread_exit(struct module *mod, long code)
 {
        module_put(mod);
-       do_exit(code);
+       kthread_exit(code);
 }
-EXPORT_SYMBOL(__module_put_and_exit);
+EXPORT_SYMBOL(__module_put_and_kthread_exit);
 
 /* Find a module section: 0 means not found. */
 static unsigned int find_sec(const struct load_info *info, const char *name)
index 72f47b372705da7518324a6ff65a825c9a01d9dd..a796d72c7dbaa6ec38de62bea9f1d6580602cb7e 100644 (file)
@@ -535,7 +535,7 @@ static int bnep_session(void *arg)
 
        up_write(&bnep_session_sem);
        free_netdev(dev);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
index 83eb84e8e688f3bcab98c99758ee99ae7f85dc46..90d130588a3e512a1fa3187ecfce14216c5bdea5 100644 (file)
@@ -323,7 +323,7 @@ static int cmtp_session(void *arg)
        up_write(&cmtp_session_sem);
 
        kfree(session);
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
index 021ab957a5c4d49b8f78efa6708d507f10886730..8ff45fb6f7007b42be048f6c1450fd75e41a42de 100644 (file)
@@ -1305,7 +1305,7 @@ static int hidp_session_thread(void *arg)
        l2cap_unregister_user(session->conn, &session->user);
        hidp_session_put(session);
 
-       module_put_and_exit(0);
+       module_put_and_kthread_exit(0);
        return 0;
 }
 
index f066837d8e1aa3a9da2bcb1a68379e939336156b..fd6714de2260e60f8e00ee97c3f815c966b04e2a 100644 (file)
@@ -171,7 +171,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
                "do_task_dead",
                "kthread_exit",
                "make_task_dead",
-               "__module_put_and_exit",
+               "__module_put_and_kthread_exit",
                "complete_and_exit",
                "__reiserfs_panic",
                "lbug_with_loc",