From patchwork Thu Mar 24 07:56:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 8658681 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 39603C0553 for ; Thu, 24 Mar 2016 07:56:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A8E1F20376 for ; Thu, 24 Mar 2016 07:56:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B6FF202E9 for ; Thu, 24 Mar 2016 07:56:40 +0000 (UTC) Received: from localhost ([::1]:48226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj08F-0005hb-9d for patchwork-qemu-devel@patchwork.kernel.org; Thu, 24 Mar 2016 03:56:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj084-0005hH-VG for qemu-devel@nongnu.org; Thu, 24 Mar 2016 03:56:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj081-0002d5-Hb for qemu-devel@nongnu.org; Thu, 24 Mar 2016 03:56:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj081-0002aq-Bg for qemu-devel@nongnu.org; Thu, 24 Mar 2016 03:56:25 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 2D1077F0A7 for ; Thu, 24 Mar 2016 07:56:23 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2O7uLUI006067; Thu, 24 Mar 2016 03:56:22 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id A3B398190B; Thu, 24 Mar 2016 08:56:20 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 24 Mar 2016 08:56:17 +0100 Message-Id: <1458806178-31096-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1458806178-31096-1-git-send-email-kraxel@redhat.com> References: <1458806178-31096-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PULL 2/3] input-linux: fix Coverity warning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Gerd Hoffmann Message-id: 1458129049-12484-1-git-send-email-kraxel@redhat.com --- ui/input-linux.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/input-linux.c b/ui/input-linux.c index 59d9348..6ddaa67 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -213,6 +213,13 @@ static void input_linux_event_keyboard(void *opaque) */ continue; } + if (event.code >= KEY_CNT) { + /* + * Should not happen. But better safe than sorry, + * and we make Coverity happy too. + */ + continue; + } /* keep track of key state */ if (!il->keydown[event.code] && event.value) { il->keydown[event.code] = true;