From 8a319e013316f5856be62aba072b82c4255434b9 Mon Sep 17 00:00:00 2001 From: chenzefeng Date: Tue, 30 Apr 2019 09:13:47 +0800 Subject: [PATCH] livepatch-patch-hook: fix memleak in the function patch_exit reason: after the function klp_unregister_patch, the lpatch must be freed, otherwise, it would cause memory leak. Signed-off-by: chenzefeng --- kmod/patch/livepatch-patch-hook.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kmod/patch/livepatch-patch-hook.c b/kmod/patch/livepatch-patch-hook.c index 7a587a3..d5dcca3 100644 --- a/kmod/patch/livepatch-patch-hook.c +++ b/kmod/patch/livepatch-patch-hook.c @@ -460,6 +460,7 @@ out: static void __exit patch_exit(void) { WARN_ON(klp_unregister_patch(lpatch)); + patch_free_livepatch(lpatch); } module_init(patch_init);