* [PATCH 5/6] pgo: modules Fixup memory leak.
@ 2021-05-28 20:11 Jarmo Tiitto
2021-05-31 18:20 ` Nathan Chancellor
0 siblings, 1 reply; 2+ messages in thread
From: Jarmo Tiitto @ 2021-05-28 20:11 UTC (permalink / raw)
To: samitolvanen
Cc: wcw, nathan, ndesaulniers, linux-kernel, clang-built-linux, Jarmo Tiitto
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 5/6] pgo: modules Fixup memory leak.
2021-05-28 20:11 [PATCH 5/6] pgo: modules Fixup memory leak Jarmo Tiitto
@ 2021-05-31 18:20 ` Nathan Chancellor
0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2021-05-31 18:20 UTC (permalink / raw)
To: Jarmo Tiitto
Cc: samitolvanen, wcw, ndesaulniers, linux-kernel, clang-built-linux
On Fri, May 28, 2021 at 11:11:07PM +0300, Jarmo Tiitto wrote:
> Signed-off-by: Jarmo Tiitto <jarmo.tiitto@gmail.com>
Similar comment to 6/6, squash this into 3/6.
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-31 18:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28 20:11 [PATCH 5/6] pgo: modules Fixup memory leak Jarmo Tiitto
2021-05-31 18:20 ` Nathan Chancellor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).