Skip to content

Commit

Permalink
x86/kaslr: Fix incorrect i8254 outb() parameters
Browse files Browse the repository at this point in the history
The outb() function takes parameters value and port, in that order.  Fix
the parameters used in the kalsr i8254 fallback code.

Fixes: 5bfce5e ("x86, kaslr: Provide randomness functions")
Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: linux@endlessm.com
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20190107034024.15005-1-drake@endlessm.com
  • Loading branch information
Daniel Drake authored and Thomas Gleixner committed Jan 11, 2019
1 parent 5962dd2 commit 7e6fc2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/lib/kaslr.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ static inline u16 i8254(void)
u16 status, timer;

do {
outb(I8254_PORT_CONTROL,
I8254_CMD_READBACK | I8254_SELECT_COUNTER0);
outb(I8254_CMD_READBACK | I8254_SELECT_COUNTER0,
I8254_PORT_CONTROL);
status = inb(I8254_PORT_COUNTER0);
timer = inb(I8254_PORT_COUNTER0);
timer |= inb(I8254_PORT_COUNTER0) << 8;
Expand Down

0 comments on commit 7e6fc2f

Please sign in to comment.