Skip to content

Commit

Permalink
sh: Fix up uninitialized variable use caught by gcc 4.4.
Browse files Browse the repository at this point in the history
In the unaligned kernel exception fixup case the printk() was ordered
before the copy_from_user(), resulting in a nonsensical instruction
value. This fixes up the ordering properly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Sep 24, 2009
1 parent 23c4c82 commit 40258ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions arch/sh/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,6 @@ asmlinkage void do_address_error(struct pt_regs *regs,
} else {
se_sys += 1;

if (se_kernmode_warn)
printk(KERN_NOTICE "Unaligned kernel access "
"on behalf of \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
current->comm, current->pid, (void *)regs->pc,
instruction);

if (regs->pc & 1)
die("unaligned program counter", regs, error_code);

Expand All @@ -697,6 +691,12 @@ asmlinkage void do_address_error(struct pt_regs *regs,
die("insn faulting in do_address_error", regs, 0);
}

if (se_kernmode_warn)
printk(KERN_NOTICE "Unaligned kernel access "
"on behalf of \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
current->comm, current->pid, (void *)regs->pc,
instruction);

handle_unaligned_access(instruction, regs,
&user_mem_access, 0);
set_fs(oldfs);
Expand Down

0 comments on commit 40258ee

Please sign in to comment.