Skip to content

Commit

Permalink
parisc: Avoid zeroing gr[0] in fixup_exception()
Browse files Browse the repository at this point in the history
Register gr[0] holds the PSW in interrupt context. It's absolutely
unlikely that the compiler will use register zero in a get_user() call,
but better BUG on such a case in fixup_exception() anyway.

Signed-off-by: Helge Deller <deller@gmx.de>
  • Loading branch information
Helge Deller committed Jun 9, 2017
1 parent 649aa24 commit b752c7b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/parisc/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ int fixup_exception(struct pt_regs *regs)
/* zero target register for get_user() */
if (parisc_acctyp(0, regs->iir) == VM_READ) {
int treg = regs->iir & 0x1f;
BUG_ON(treg == 0);
regs->gr[treg] = 0;
}
}
Expand Down

0 comments on commit b752c7b

Please sign in to comment.