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 8E468740038 for ; Tue, 7 Nov 2023 05:39:08 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=LuspGMPo1NEv4j+DVf+XlGoO4xvHGZ0A+GFZ02PxqS8=; 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=1699335547; v=1; b=oSOYOOuik8RxaLQhwzMr73ZJtXPE+p4f0xlqnCKPu530BnHtWO6AQz4IwsFmtE56oBnGhm14 g5t5IoFPgkZzpoluET6xVWABRmiAPxTciybznGVDa8ITL+uEMpcOTMDWOTLiHRJnk5ok7DfhULB xxRBuEQy0cKLGUXL1n0Zt9v4= X-Received: by 127.0.0.2 with SMTP id Nkf7YY7687511xZIFbbKz6Fa; Mon, 06 Nov 2023 21:39:07 -0800 X-Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) by mx.groups.io with SMTP id smtpd.web11.4245.1699335546682343715 for ; Mon, 06 Nov 2023 21:39:06 -0800 X-Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-359974f4c7eso10287755ab.1 for ; Mon, 06 Nov 2023 21:39:06 -0800 (PST) X-Gm-Message-State: 083W9xop8JosCd9gtLGJyOBAx7686176AA= X-Google-Smtp-Source: AGHT+IFmgux9IP/RvbQg6AVc+0p4VHtMDkr8gINLicnVzg9B6INcY9S15RS18lBvHkMq/+edIUqjhA== X-Received: by 2002:a92:c269:0:b0:358:21a:25f9 with SMTP id h9-20020a92c269000000b00358021a25f9mr2053734ild.20.1699335545607; Mon, 06 Nov 2023 21:39:05 -0800 (PST) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1f24:775d:7335:84a5:7d11:9393]) by smtp.gmail.com with ESMTPSA id r5-20020a92c5a5000000b00357ff86c542sm2953080ilt.4.2023.11.06.21.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 21:39:05 -0800 (PST) From: "Ranbir Singh" To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Ray Ni , Laszlo Ersek Subject: [edk2-devel] [PATCH v3 2/2] MdeModulePkg/Bus/Usb/UsbMouseDxe: Fix MISSING_BREAK Coverity issues Date: Tue, 7 Nov 2023 11:08:53 +0530 Message-Id: <20231107053853.76448-3-rsingh@ventanamicro.com> In-Reply-To: <20231107053853.76448-1-rsingh@ventanamicro.com> References: <20231107053853.76448-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=oSOYOOui; 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: Ray Ni Signed-off-by: Ranbir Singh Reviewed-by: Laszlo Ersek --- 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 (#110804): https://edk2.groups.io/g/devel/message/110804 Mute This Topic: https://groups.io/mt/102437987/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-