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 <chenzefeng2@huawei.com>
This commit is contained in:
chenzefeng 2019-04-30 09:13:47 +08:00
parent d79eb87926
commit 8a319e0133
1 changed files with 1 additions and 0 deletions

View File

@ -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);