Skip to content

Commit

Permalink
Blackfin arch: fix bug - gdb signull case make trunk kernel panic fre…
Browse files Browse the repository at this point in the history
…quently

Use copy_to_user_page and copy_from_user_page instead of
memcpy. copy_to_user_page does cache flush when necessary.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
  • Loading branch information
Jie Zhang authored and Bryan Wu committed Mar 5, 2009
1 parent 27276ba commit 7786ce8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/blackfin/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <asm/asm-offsets.h>
#include <asm/dma.h>
#include <asm/fixed_code.h>
#include <asm/cacheflush.h>
#include <asm/mem_map.h>

#define TEXT_OFFSET 0
Expand Down Expand Up @@ -240,7 +241,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)

} else if (addr >= FIXED_CODE_START
&& addr + sizeof(tmp) <= FIXED_CODE_END) {
memcpy(&tmp, (const void *)(addr), sizeof(tmp));
copy_from_user_page(0, 0, 0, &tmp, (const void *)(addr), sizeof(tmp));
copied = sizeof(tmp);

} else
Expand Down Expand Up @@ -320,7 +321,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)

} else if (addr >= FIXED_CODE_START
&& addr + sizeof(data) <= FIXED_CODE_END) {
memcpy((void *)(addr), &data, sizeof(data));
copy_to_user_page(0, 0, 0, (void *)(addr), &data, sizeof(data));
copied = sizeof(data);

} else
Expand Down

0 comments on commit 7786ce8

Please sign in to comment.