[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=wi8DJaMMxjYTex8A_FiB0071Tk_dx1pudtUpD@mail.gmail.com>
Date: Fri, 5 Nov 2010 13:44:38 +0800
From: jovi zhang <bookjovi@...il.com>
To: 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: [PATCH] kdb: fix memory leak
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)
Powered by blists - more mailing lists