From 03523cd5f8d6dbb07b094c2f61b17058068f21e5 Mon Sep 17 00:00:00 2001 From: Cong Ding Date: Mon, 14 Jan 2013 07:26:32 +0000 Subject: [PATCH] --- yaml --- r: 349326 b: refs/heads/master c: fefd9e6f8860249b2c284d89cb2e51fa71a9503a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/kgdb.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index c4872ef04cd1..f13eb9d8d11a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 572177d7c77db1981ba2563e01478126482c43bc +refs/heads/master: fefd9e6f8860249b2c284d89cb2e51fa71a9503a diff --git a/trunk/arch/powerpc/kernel/kgdb.c b/trunk/arch/powerpc/kernel/kgdb.c index c470a40b29f5..a7bc7521c064 100644 --- a/trunk/arch/powerpc/kernel/kgdb.c +++ b/trunk/arch/powerpc/kernel/kgdb.c @@ -154,12 +154,12 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs) static int kgdb_singlestep(struct pt_regs *regs) { struct thread_info *thread_info, *exception_thread_info; - struct thread_info *backup_current_thread_info = \ - (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL); + struct thread_info *backup_current_thread_info; if (user_mode(regs)) return 0; + backup_current_thread_info = (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL); /* * On Book E and perhaps other processors, singlestep is handled on * the critical exception stack. This causes current_thread_info() @@ -185,6 +185,7 @@ static int kgdb_singlestep(struct pt_regs *regs) /* Restore current_thread_info lastly. */ memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info); + kfree(backup_current_thread_info); return 1; }