From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3L9p-0005Ar-4l for qemu-devel@nongnu.org; Thu, 19 May 2016 06:26:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3L9n-0005Ud-Nj for qemu-devel@nongnu.org; Thu, 19 May 2016 06:26:21 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:33861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3L9n-0005UQ-JM for qemu-devel@nongnu.org; Thu, 19 May 2016 06:26:19 -0400 Received: by mail-qk0-x242.google.com with SMTP id i7so7121904qkd.1 for ; Thu, 19 May 2016 03:26:19 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: marcandre.lureau@redhat.com Date: Thu, 19 May 2016 12:26:00 +0200 Message-Id: <1463653560-26958-7-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1463653560-26958-1-git-send-email-marcandre.lureau@redhat.com> References: <1463653560-26958-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 6/6] virtio-gpu: fix ui idx check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-André Lureau Fix off-by-one value check (0 is the first scanout). Signed-off-by: Marc-André Lureau --- hw/display/virtio-gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 5811a2d..d1f25d5 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -878,7 +878,7 @@ static int virtio_gpu_ui_info(void *opaque, uint32_t idx, QemuUIInfo *info) { VirtIOGPU *g = opaque; - if (idx > g->conf.max_outputs) { + if (idx >= g->conf.max_outputs) { return -1; } -- 2.7.4