From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3624C7803CF for ; Mon, 9 Oct 2023 11:28:44 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ZD2lH0lb98ySceREbbLa4F6kyV88akOVIVn5d6PrMX4=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696850922; v=1; b=GlgHD03sNjAoDvIJT60Vv/Ojnzdl++dKZC5zds0JyIQ2Z4LEbUeTVuT5/DDOM/m46P3m1eka X/U/4XlVPLtQE0m4xhSfv29B/D1NsZGWx2Qyf3ISZ8lS35mWyr2LNCsFlpqOun5zumA2Euk5CjF eu1wC2vIA635YZeVYvUB+LI8= X-Received: by 127.0.0.2 with SMTP id bLDmYY7687511xxDveUGCws3; Mon, 09 Oct 2023 04:28:42 -0700 X-Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mx.groups.io with SMTP id smtpd.web10.59237.1696850922436459584 for ; Mon, 09 Oct 2023 04:28:42 -0700 X-Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-278fde50024so4072625a91.1 for ; Mon, 09 Oct 2023 04:28:42 -0700 (PDT) X-Gm-Message-State: tdl9677ZTZkCk5Q93zJuPsgfx7686176AA= X-Google-Smtp-Source: AGHT+IEafGkPQkU/D4w6pDPcGepfW5zQHf8FC1eY/qWbNjWnxXNgua9pnmkCtqHWB+mc3x8UvP3obQ== X-Received: by 2002:a17:90a:1c0f:b0:263:f521:da3e with SMTP id s15-20020a17090a1c0f00b00263f521da3emr18339486pjs.2.1696850921071; Mon, 09 Oct 2023 04:28:41 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1cbd:fb:a57a:2893:69ae:bff3]) by smtp.gmail.com with ESMTPSA id m20-20020a17090a7f9400b00262ca945cecsm9993713pjl.54.2023.10.09.04.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 04:28:40 -0700 (PDT) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH v2 2/2] MdeModulePkg/Bus/Usb/UsbMouseDxe: Fix MISSING_BREAK Coverity issues Date: Mon, 9 Oct 2023 16:58:32 +0530 Message-Id: <20231009112832.225861-3-rsingh@ventanamicro.com> In-Reply-To: <20231009112832.225861-1-rsingh@ventanamicro.com> References: <20231009112832.225861-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rsingh@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=GlgHD03s; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io The function GetNextHidItem has a switch-case block in which the case 1: falls through to case 2: and then case 2: falls through to case 3:. There is no possibility of the if blocks within case 2: and case 3: to succeed later and not succeed in the original case and hence the fall throughs even if it hypothetically happens are redundant as the code still will eventually return NULL only at the function end point. Better introduce straight forward break; statement within actual cases. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4222 Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c b/MdeModulePkg/Bus= /Usb/UsbMouseDxe/MouseHid.c index acc19acd98e0..f07e48774a34 100644 --- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c +++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/MouseHid.c @@ -89,6 +89,8 @@ GetNextHidItem ( return StartPos;=0D }=0D =0D + break;=0D +=0D case 2:=0D //=0D // 2-byte data=0D @@ -99,6 +101,8 @@ GetNextHidItem ( return StartPos;=0D }=0D =0D + break;=0D +=0D case 3:=0D //=0D // 4-byte data, adjust size=0D @@ -109,6 +113,8 @@ GetNextHidItem ( StartPos +=3D 4;=0D return StartPos;=0D }=0D +=0D + break;=0D }=0D }=0D =0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109457): https://edk2.groups.io/g/devel/message/109457 Mute This Topic: https://groups.io/mt/101849998/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-