From b9dead1a751abe93348059ee2465006a0240d05a Mon Sep 17 00:00:00 2001 From: Will McVicker Date: Thu, 7 Mar 2024 11:15:37 -0800 Subject: [PATCH] toolbox/modprobe: Fix failure due to blocklist When a module is blocklisted, LoadWithAliases() will return an error indicating the module failed to load. When the blocklist is requested (via the -b parameter), let's not return an error if a blocklisted module fails to load. Test: verified lsmod on pixel 6 Bug: 324018983 Change-Id: I68f7d46bf9fd99e4b4e51ef92ea71686907f1125 --- toolbox/modprobe.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolbox/modprobe.cpp b/toolbox/modprobe.cpp index 17d4e319b..56cf140e1 100644 --- a/toolbox/modprobe.cpp +++ b/toolbox/modprobe.cpp @@ -257,6 +257,7 @@ extern "C" int modprobe_main(int argc, char** argv) { switch (mode) { case AddModulesMode: if (!m.LoadWithAliases(module, true, module_parameters)) { + if (m.IsBlocklisted(module)) continue; PLOG(ERROR) << "Failed to load module " << module; rv = EXIT_FAILURE; }