[PATCH] modprobe: rmmod_do_module: Free kmod list of holders

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Fixes: 42b32d30c38e ("modprobe: Fix holders removal")
Signed-off-by: Nicolas Schier <n.schier@xxxxxx>
---
Resend as a separate patch as suggested in https://lore.kernel.org/linux-modules/20230412192151.jbbcltmcwwamhlm6@xxxxxxxxxxxxxxxxxx/
---
 tools/modprobe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/modprobe.c b/tools/modprobe.c
index 3b7897c..e891028 100644
--- a/tools/modprobe.c
+++ b/tools/modprobe.c
@@ -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,
-- 
Nicolas Schier



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux