[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/8] qxl/update_area_io: cleanup invalid parameters
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 2/8] qxl/update_area_io: cleanup invalid parameters handling |
Date: |
Mon, 8 Oct 2012 12:49:45 +0200 |
From: Michael Tokarev <address@hidden>
This cleans up two additions of almost the same code in commits
511b13e2c9 and ccc2960d654. While at it, make error paths
consistent (always use 'break' instead of 'return').
Signed-off-by: Michael Tokarev <address@hidden>
Cc: Dunrong Huang <address@hidden>
Cc: Alon Levy <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/qxl.c | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
index 33169f3..3c82c2a 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1547,20 +1547,13 @@ async_common:
if (d->ram->update_surface > d->ssd.num_surfaces) {
qxl_set_guest_bug(d, "QXL_IO_UPDATE_AREA: invalid surface id %d\n",
d->ram->update_surface);
- return;
+ break;
}
- if (update.left >= update.right || update.top >= update.bottom) {
+ if (update.left >= update.right || update.top >= update.bottom ||
+ update.left < 0 || update.top < 0) {
qxl_set_guest_bug(d,
"QXL_IO_UPDATE_AREA: invalid area (%ux%u)x(%ux%u)\n",
update.left, update.top, update.right, update.bottom);
- return;
- }
-
- if (update.left < 0 || update.top < 0 || update.left >= update.right ||
- update.top >= update.bottom) {
- qxl_set_guest_bug(d, "QXL_IO_UPDATE_AREA: "
- "invalid area(%d,%d,%d,%d)\n", update.left,
- update.right, update.top, update.bottom);
break;
}
if (async == QXL_ASYNC) {
--
1.7.1
- [Qemu-devel] [PULL 0/8] spice patch queue, Gerd Hoffmann, 2012/10/08
- [Qemu-devel] [PATCH 3/8] qxl: fix range check for rev3 io commands., Gerd Hoffmann, 2012/10/08
- [Qemu-devel] [PATCH 8/8] qxl: set default revision to 4, Gerd Hoffmann, 2012/10/08
- [Qemu-devel] [PATCH 6/8] hw/qxl: qxl_dirty_surfaces: use uintptr_t, Gerd Hoffmann, 2012/10/08
- [Qemu-devel] [PATCH 7/8] spice: raise requirement to 0.12, Gerd Hoffmann, 2012/10/08
- [Qemu-devel] [PATCH 1/8] qxl: always update displaysurface on resize, Gerd Hoffmann, 2012/10/08
- [Qemu-devel] [PATCH 5/8] hw/qxl: fix condition for exiting guest_bug, Gerd Hoffmann, 2012/10/08
- [Qemu-devel] [PATCH 2/8] qxl/update_area_io: cleanup invalid parameters handling,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 4/8] hw/qxl: exit on failure to register qxl interface, Gerd Hoffmann, 2012/10/08
- Re: [Qemu-devel] [PULL 0/8] spice patch queue, Anthony Liguori, 2012/10/12