From 95d4eea68f66890458e2ce62f2a53635045f5f89 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Mon, 11 Nov 2019 13:34:17 +0100 Subject: [PATCH] modules: Unload modules in reverse order from loading Make sure a module A that is needed by B is not unloaded before B. --- src/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.c b/src/module.c index 9eb282f0..a8f82015 100644 --- a/src/module.c +++ b/src/module.c @@ -173,7 +173,7 @@ void iwd_modules_exit() return; for (i = 0; i < n_modules; i++) { - desc = modules_sorted[i]; + desc = modules_sorted[n_modules - 1 - i]; if (!desc->active) continue;