[LTP] [PATCH 1/1] lib/tst_module.c: Replace "rmmod" with "modprobe -r"

Petr Vorel pvorel@suse.cz
Fri Nov 3 17:03:50 CET 2023


"modprobe -r" will remove also the dependencies loaded for kernel
modules.

Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_module.c b/lib/tst_module.c
index 9bd443623..e52bb6e00 100644
--- a/lib/tst_module.c
+++ b/lib/tst_module.c
@@ -105,7 +105,7 @@ void tst_module_unload_(void (cleanup_fn)(void), const char *mod_name)
 {
 	int i, rc;
 
-	const char *const argv[] = { "rmmod", mod_name, NULL };
+	const char *const argv[] = { "modprobe", "-r", mod_name, NULL };
 
 	rc = 1;
 	for (i = 0; i < 50; i++) {
-- 
2.42.0



More information about the ltp mailing list