lkml.org 
[lkml]   [2021]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/6] pgo: modules Fixup memory leak.
Date
Signed-off-by: Jarmo Tiitto <jarmo.tiitto@gmail.com>
---
kernel/pgo/fs_mod.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/pgo/fs_mod.c b/kernel/pgo/fs_mod.c
index 0808d44227f1..2d1ff99e7982 100644
--- a/kernel/pgo/fs_mod.c
+++ b/kernel/pgo/fs_mod.c
@@ -261,6 +261,8 @@ static int prf_module_open(struct inode *inode, struct file *file)

if (!pinfo->buffer) {
err = -ENOMEM;
+ kfree(pinfo);
+ module_put(mod);
goto out;
}
}
@@ -373,7 +375,7 @@ static int pgo_module_notifier(struct notifier_block *nb, unsigned long event,
if (strcmp(data->mod->name, mod->name) == 0) {

mutex_lock(&prf_mod_lock);
- /* remofe from profiled modules */
+ /* remove from profiled modules */
list_del_rcu(&data->link);
/* mark it stale */
WRITE_ONCE(data->mod, NULL);
--
2.31.1
\
 
 \ /
  Last update: 2021-05-28 22:11    [W:0.030 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site