linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rakib Mullick <rakib.mullick@gmail.com>
To: Akhilesh Kumar <akhilesh.lxr@gmail.com>
Cc: ananth@in.ibm.com, anil.s.keshavamurthy@intel.com,
	davem@davemloft.net, masami.hiramatsu.pt@hitachi.com,
	linux-kernel@vger.kernel.org
Subject: Re: [Memory Leak] free kprobe before optimized_kprobe free
Date: Thu, 23 Aug 2012 23:19:55 +0600	[thread overview]
Message-ID: <CADZ9YHjp63UP7Oc2nitGsQB=fAJjGZqSp9P0zDQAA1U+=Q0UJQ@mail.gmail.com> (raw)
In-Reply-To: <CADArhcAGV0iTAGirT6XPcVCwOKu-yg_MThk2J+ViK46CLL6Xkw@mail.gmail.com>

On 8/23/12, Akhilesh Kumar <akhilesh.lxr@gmail.com> wrote:
> From a77438899c7295299b59cdca8d1816ea69d6ed8e Mon Sep 17 00:00:00 2001
> From: Akhilesh Kumar <akhilesh.lxr@gmail.com>
> Date: Fri, 10 Aug 2012 14:02:07 +0530
> Subject:[Memory Leak] free kprobe before optimized_kprobe free
>
> Free *ap before *op otherwise ap pointer will be Dangling
>
> Signed-off-by: Akhilesh Kumar <akhilesh.lxr@gmail.com>

An usual way to submit a patch is to mark the subject line with
[patch] tag, not [memory leak].

Thanks,
Rakib

> ---
>  kernel/kprobes.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index c62b854..ff0a97b 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -767,6 +767,7 @@ static __kprobes void
> try_to_optimize_kprobe(struct kprobe *p)
>  	if (!arch_prepared_optinsn(&op->optinsn)) {
>  		/* If failed to setup optimizing, fallback to kprobe */
>  		arch_remove_optimized_kprobe(op);
> +		kfree(ap);
>  		kfree(op);
>  		return;
>  	}
> --
> 1.7.8.4
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

  reply	other threads:[~2012-08-23 17:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23 17:10 [Memory Leak] free kprobe before optimized_kprobe free Akhilesh Kumar
2012-08-23 17:19 ` Rakib Mullick [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-08-23 17:05 akhilesh kumar
2012-08-24  2:04 ` Masami Hiramatsu

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='CADZ9YHjp63UP7Oc2nitGsQB=fAJjGZqSp9P0zDQAA1U+=Q0UJQ@mail.gmail.com' \
    --to=rakib.mullick@gmail.com \
    --cc=akhilesh.lxr@gmail.com \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.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).