]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Fix overflow bug in overflow detection code
authorEric Sesterhenn / Snakebyte <snakebyte@gmx.de>
Mon, 9 Apr 2007 14:15:05 +0000 (16:15 +0200)
committerAvi Kivity <avi@qumranet.com>
Thu, 3 May 2007 07:52:29 +0000 (10:52 +0300)
commite37ec6aecae585cf68f63ddad97f61843e75cb12
treed093a2be86855e37abe7783e257eac4d9eb0ae73
parentd58e0330533202231bb16503c825b8dcc0c78f7c
KVM: Fix overflow bug in overflow detection code

The expression

   sp - 6 < sp

where sp is a u16 is undefined in C since 'sp - 6' is promoted to int,
and signed overflow is undefined in C.  gcc 4.2 actually warns about it.
Replace with a simpler test.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/vmx.c