linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Jarmo Tiitto <jarmo.tiitto@gmail.com>
Cc: samitolvanen@google.com, wcw@google.com, ndesaulniers@google.com,
	linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH 5/6] pgo: modules Fixup memory leak.
Date: Mon, 31 May 2021 11:20:24 -0700	[thread overview]
Message-ID: <YLUo6HrhWmeg2g1w@Ryzen-9-3900X.localdomain> (raw)
In-Reply-To: <20210528201107.459362-1-jarmo.tiitto@gmail.com>

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

      reply	other threads:[~2021-05-31 18:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 20:11 [PATCH 5/6] pgo: modules Fixup memory leak Jarmo Tiitto
2021-05-31 18:20 ` Nathan Chancellor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLUo6HrhWmeg2g1w@Ryzen-9-3900X.localdomain \
    --to=nathan@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=jarmo.tiitto@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=samitolvanen@google.com \
    --cc=wcw@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).