diff options
| -rw-r--r-- | arch/powerpc/kernel/kgdb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index c470a40b29f5..a7bc7521c064 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c | |||
| @@ -154,12 +154,12 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs) | |||
| 154 | static int kgdb_singlestep(struct pt_regs *regs) | 154 | static int kgdb_singlestep(struct pt_regs *regs) |
| 155 | { | 155 | { |
| 156 | struct thread_info *thread_info, *exception_thread_info; | 156 | struct thread_info *thread_info, *exception_thread_info; |
| 157 | struct thread_info *backup_current_thread_info = \ | 157 | struct thread_info *backup_current_thread_info; |
| 158 | (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL); | ||
| 159 | 158 | ||
| 160 | if (user_mode(regs)) | 159 | if (user_mode(regs)) |
| 161 | return 0; | 160 | return 0; |
| 162 | 161 | ||
| 162 | backup_current_thread_info = (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL); | ||
| 163 | /* | 163 | /* |
| 164 | * On Book E and perhaps other processors, singlestep is handled on | 164 | * On Book E and perhaps other processors, singlestep is handled on |
| 165 | * the critical exception stack. This causes current_thread_info() | 165 | * the critical exception stack. This causes current_thread_info() |
| @@ -185,6 +185,7 @@ static int kgdb_singlestep(struct pt_regs *regs) | |||
| 185 | /* Restore current_thread_info lastly. */ | 185 | /* Restore current_thread_info lastly. */ |
| 186 | memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info); | 186 | memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info); |
| 187 | 187 | ||
| 188 | kfree(backup_current_thread_info); | ||
| 188 | return 1; | 189 | return 1; |
| 189 | } | 190 | } |
| 190 | 191 | ||
