[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTi=yWUqROeAMQG7FKU1xcGHOxwXuh=X3Zm3DP8v7@mail.gmail.com>
Date: Fri, 5 Nov 2010 15:46:26 +0800
From: Dongdong Deng <libfetion@...il.com>
To: jovi zhang <bookjovi@...il.com>
Cc: Jason Wessel <jason.wessel@...driver.com>,
Martin Hicks <mort@....com>, Dmitry Torokhov <dtor@...l.ru>,
Andrew Morton <akpm@...ux-foundation.org>,
Rusty Russell <rusty@...tcorp.com.au>,
kgdb-bugreport@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kdb: fix memory leak
On Fri, Nov 5, 2010 at 1:44 PM, jovi zhang <bookjovi@...il.com> wrote:
> fix memory leak in kdb_main.c
>
> Signed-off-by: jovi zhang <bookjovi@...il.com>
> kernel/debug/kdb/kdb_main.c | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
> index 37755d6..3ab3fee 100644
> --- a/kernel/debug/kdb/kdb_main.c
> +++ b/kernel/debug/kdb/kdb_main.c
> @@ -2361,7 +2361,7 @@ static int kdb_pid(int argc, const char **argv)
> */
> static int kdb_ll(int argc, const char **argv)
> {
> - int diag;
> + int diag = 0;
> unsigned long addr;
> long offset = 0;
> unsigned long va;
> @@ -2400,20 +2400,21 @@ static int kdb_ll(int argc, const char **argv)
> char buf[80];
>
> if (KDB_FLAG(CMD_INTERRUPT))
> - return 0;
> + goto out;
>
> sprintf(buf, "%s " kdb_machreg_fmt "\n", command, va);
> diag = kdb_parse(buf);
> if (diag)
> - return diag;
> + goto out;
>
> addr = va + linkoffset;
> if (kdb_getword(&va, addr, sizeof(va)))
> - return 0;
> + goto out;
> }
> - kfree(command);
>
> - return 0;
> +out:
> + kfree(command);
> + return diag;
> }
>
> static int kdb_kgdb(int argc, const char **argv)
>
It is ok for me. :-)
Dongdong
Powered by blists - more mailing lists