From patchwork Fri Jul 6 17:14:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 940644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="sNJy233H"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41MhM03Qzgz9s4Z for ; Sat, 7 Jul 2018 03:20:28 +1000 (AEST) Received: from localhost ([::1]:59018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbUPC-0004aq-3J for incoming@patchwork.ozlabs.org; Fri, 06 Jul 2018 13:20:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbUK6-0001H9-F3 for qemu-devel@nongnu.org; Fri, 06 Jul 2018 13:15:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbUK5-0000nl-Er for qemu-devel@nongnu.org; Fri, 06 Jul 2018 13:15:10 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36739) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbUK5-0000mx-6z for qemu-devel@nongnu.org; Fri, 06 Jul 2018 13:15:09 -0400 Received: by mail-wm0-x244.google.com with SMTP id s14-v6so15139228wmc.1 for ; Fri, 06 Jul 2018 10:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=+Br/NtQF9jrVEo+0S0Ax/D412qjzQYpqRMea5neg5QM=; b=sNJy233H10H9pInA5X9pS86yQ/OR/Odiuao4kI9IoBQAybrU4v53k6dLN36chCRiQI n3HzSwkhC5zhiFqvtLCB9dUGcOu6twCZ1m1SSCiJavj7Lx8GrvrdFKZ8NbsgQBP6iwb4 zbB91dvifrZ0VPm29XEDyuMJDVKGPE3G3ueoD9Yeo8g8R4QBhZzG/HBXeHlC9xViicBc NVx71aQSlR9pGKHKy28Ycy/P94dCuJztWpsm40YhWk/uAyke3eDRMuCYRDvrAZpzJddh kdOxcgGv1eWe/KCmPL1RtWnPVqoX1iFFeBAwnWvMKflK1au9RfAAV8kYOLc9uMG2DCWO alcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=+Br/NtQF9jrVEo+0S0Ax/D412qjzQYpqRMea5neg5QM=; b=PNOQsPuzynD7zpDEoNDAmRGOPTlQ61PBHDpYcz5q+h3QHKxiXLiZEiGwndVbJ25wVY a2gseY25vROMe4f5Csm6x0AI9sZ3hJd+ir4vHfjclYD+ereoqmIMQ+K4r/lMMTLYQaG8 hQUWFb12eEFve0AdG4G8JZwcwYR4OoHmZAfbqTjhU8bnbydXJyk+tQpY6+CKFb0eaIeU gOani0OUFJHz/QcAZuujMJD2xwQ9nx+yforr+vCZp5VXT+/+XclX0LuSkTy2AYbwNh6t nIplCOWfEaDgvbOd0f0THdrkbM6C6YpYs2/OkNkn9WCCE1kKlBSd73umL7YqVCS24tJ/ 5H1w== X-Gm-Message-State: APt69E1m4WqGR+7TO1kPTiMbE2Pw5CG8SdrMTvKB5PIJ0we9Ul7cwjvK hy2d8gk0BRpMb98lrtWWB+sS01pF X-Google-Smtp-Source: AAOMgpeGrYcsi3CIj3RiL8DjbVThtz6AmfPb4h2+ZxoPtSAla/6tiSrRLViuUumEfMG79SXS9CTyrw== X-Received: by 2002:a1c:ee5d:: with SMTP id m90-v6mr6953973wmh.113.1530897308023; Fri, 06 Jul 2018 10:15:08 -0700 (PDT) Received: from 640k.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id h40-v6sm13784683wrf.40.2018.07.06.10.15.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 10:15:07 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 6 Jul 2018 19:14:27 +0200 Message-Id: <1530897268-22932-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530897268-22932-1-git-send-email-pbonzini@redhat.com> References: <1530897268-22932-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 7/8] ioapic: remove useless lower bounds check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The vector cannot be negative. Coverity now reports this because it sees an array access before the check, in ioapic_stat_update_irq. Reviewed-by: Peter Xu Signed-off-by: Paolo Bonzini --- hw/intc/ioapic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index b393780..b6896ac 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -152,7 +152,7 @@ static void ioapic_set_irq(void *opaque, int vector, int level) if (vector == 0) { vector = 2; } - if (vector >= 0 && vector < IOAPIC_NUM_PINS) { + if (vector < IOAPIC_NUM_PINS) { uint32_t mask = 1 << vector; uint64_t entry = s->ioredtbl[vector];