Skip to contentSkip to conversation

modprobe: rmmod_do_module: Free kmod list of holders

PATCH Applied Nicolas Schier 2 participants 2 messages Apr 18, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 modprobe: rmmod_do_module: Free kmod list of holders

Add a missing kmod_module_unref_list() to fix a memory leak.

Fixes 42b32d30c38e ("modprobe: Fix holders removal")

---
Resend as a separate patch as suggested in https://lore.kernel.org/linux-modules/[email protected]/

---
 tools/modprobe.c | 1 +
 1 file changed, 1 insertion(+)
tools/modprobe.c +1 -0
index 3b7897c..e891028 100644
@@ -455,6 +455,7 @@ static int rmmod_do_module(struct kmod_module *mod, int flags)
 		struct kmod_list *holders = kmod_module_get_holders(mod);
 
 		err = rmmod_do_modlist(holders, true);
+		kmod_module_unref_list(holders);
 		if (err < 0)
 			goto error;
 	}

---
base-commit: 3d1bd339ab942ea47e60f053f4b11b0c47ff082b
change-id: 20230418-add-missing-kmod_module_unref_list-e7c4dd5b6625

Best regards,

Signature · 1 line
Nicolas Schier
#1 lore raw
Quoted 3 lines · Nicolas Schier

Add a missing kmod_module_unref_list() to fix a memory leak.

Applied, thanks!

[1/1] modprobe: rmmod_do_module: Free kmod list of holders

      commit: 116e7c7fc00e8565caf913399c38852975094a75

Best regards,

Signature · 1 line
Lucas De Marchi