aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-04-22 08:04:21 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-22 08:04:21 -0500
commitd639498852773a6019cf1b970dd8dc2f3791c45b (patch)
tree452e64ff4b03f6538d469a5e484dddd6e4248f33 /ui
parent68c0aa6e02f79f8825c0c5dc4c7ed25d524aaa8b (diff)
parentdcc6ceffc066745777960a1f0d32f3a555924f65 (diff)
Merge remote-tracking branch 'luiz/queue/qmp' into staging
# By Amos Kong (1) and Luiz Capitulino (1) # Via Luiz Capitulino * luiz/queue/qmp: virtio-balloon: fix integer overflow in BALLOON_CHANGE QMP event monitor: fix the wrong order of releasing keys Message-id: 1366375833-995-1-git-send-email-lcapitulino@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/input.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ui/input.c b/ui/input.c
index 9abef0cd78..ecfeb43824 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -234,13 +234,11 @@ static void free_keycodes(void)
static void release_keys(void *opaque)
{
- int i;
-
- for (i = 0; i < keycodes_size; i++) {
- if (keycodes[i] & 0x80) {
+ while (keycodes_size > 0) {
+ if (keycodes[--keycodes_size] & 0x80) {
kbd_put_keycode(0xe0);
}
- kbd_put_keycode(keycodes[i]| 0x80);
+ kbd_put_keycode(keycodes[keycodes_size] | 0x80);
}
free_keycodes();