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

Edward Liaw edliaw@google.com
Fri Nov 3 17:53:45 CET 2023


Hi,



On Fri, Nov 3, 2023 at 9:03 AM Petr Vorel <pvorel@suse.cz> wrote:
>
> "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
>

This is fine with all the supported versions of Android GKI.
Reviewed-by: Edward Liaw <edliaw@google.com>


More information about the ltp mailing list