From nobody Mon Feb 9 10:28:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106994+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106994+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1689670925; cv=none; d=zohomail.com; s=zohoarc; b=BTSXb5+HAXwlnKdjASrgcm8pMUMSwN+gdHLHkk1BTpny1S9JPuL+RroCofGbNiI8ztF/BBJz6GdxpbzvkRas4VxXim0Pb4cj2BukXQCm7ljgq1lmyTmmzGtKMqMcTdbIabhfYrmtcomx+fd/LDv58CmGY19Gfm7OfCNPP8BtCAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689670925; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Eqw17d6sY0Gfc3JX+Lq8joksk8irQI+IDqQv1zEZePE=; b=cO0gtXaHU0fYpWhe+1Ze2HQhTaijzKmLvhkLRXtXYg8GrJ4HqddXzvYCAXA0kgckwFC0CsCDTCPLdnzOdxxFygyKBam6Fc4/HlB6szKahsgAKK5JYCQH9FMOEYu7qv8WbPI+GqpZayKWE6A64XjK/OfzqN9oPnHdOpKrTQun5q8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106994+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1689670925161662.9510449173123; Tue, 18 Jul 2023 02:02:05 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=iV/c/pRE9XF6jwv7tHBvy4F4Neh2WI09aRTsr+yO4Ao=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Gm-Message-State:X-Google-Smtp-Source:X-Received:X-Received:From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Unsubscribe:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:Content-Transfer-Encoding; s=20140610; t=1689670924; v=1; b=d0BQXNQnlH3IE0vC84U9Hhvnd60o461sWDjq2xMuPiKGl7KAsTmIAXosIVLG5kAyFP4TDAAa Zo8e7NJuyOHeUdtemt/5lXcXZ1fDzgCkEZn51XuZyCzhGUUoNskR4NOTF2mDDiV53TCiT2/XuuR mK+CuHzGD5zytP7UwPKDdYpw= X-Received: by 127.0.0.2 with SMTP id jf3kYY1788612xCwSpzBnxEE; Tue, 18 Jul 2023 02:02:04 -0700 X-Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mx.groups.io with SMTP id smtpd.web10.5970.1689593918585236682 for ; Mon, 17 Jul 2023 04:38:38 -0700 X-Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-666e916b880so2768156b3a.2 for ; Mon, 17 Jul 2023 04:38:38 -0700 (PDT) X-Gm-Message-State: VUzNYaPO21uC8vlweJTzhRcbx1787277AA= X-Google-Smtp-Source: APBJJlELr5SX/5Vz0XbDTdA4lCPueKkSOhEwTzjrtvvgpO55jtPn1gVGh74/Jb8BX44UaZQxDV7vlQ== X-Received: by 2002:a05:6a20:3d8a:b0:133:7fe3:6831 with SMTP id s10-20020a056a203d8a00b001337fe36831mr12838124pzi.57.1689593917743; Mon, 17 Jul 2023 04:38:37 -0700 (PDT) X-Received: from user-Latitude-5420.dc1.ventanamicro.com ([2401:4900:1cbd:8dd2:c2bf:93e0:5979:e5e0]) by smtp.gmail.com with ESMTPSA id a23-20020a637f17000000b0055b3af821d5sm12667349pgd.25.2023.07.17.04.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 04:38:37 -0700 (PDT) From: Ranbir Singh To: devel@edk2.groups.io, rsingh@ventanamicro.com Cc: Hao A Wu , Ray Ni , Veeresh Sangolli Subject: [edk2-devel] [PATCH v1 1/2] MdeModulePkg/Bus/Pci/UhciDxe: Fix BAD_SHIFT Coverity issue Date: Mon, 17 Jul 2023 17:08:30 +0530 Message-Id: <20230717113831.2290882-2-rsingh@ventanamicro.com> In-Reply-To: <20230717113831.2290882-1-rsingh@ventanamicro.com> References: <20230717113831.2290882-1-rsingh@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1689670925753100017 Content-Type: text/plain; charset="utf-8" From: Ranbir Singh The function UhciConvertPollRate has a check ASSERT (Interval !=3D 0); but this comes into play only in DEBUG mode. In Release mode, there is no handling if the Interval parameter value is ZERO. To avoid shifting by a negative amount later in the code flow in this undesirable case, it is better to handle it as well by simply returning ZERO. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4211 Cc: Hao A Wu Cc: Ray Ni Co-authored-by: Veeresh Sangolli Signed-off-by: Ranbir Singh Signed-off-by: Ranbir Singh --- MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c b/MdeModulePkg/Bus/Pc= i/UhciDxe/UhciSched.c index c08f9496969b..8ddef4b68ccf 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c @@ -214,6 +214,10 @@ UhciConvertPollRate ( =20 ASSERT (Interval !=3D 0); =20 + if (Interval =3D=3D 0) { + return 0; + } + // // Find the index (1 based) of the highest non-zero bit // --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106994): https://edk2.groups.io/g/devel/message/106994 Mute This Topic: https://groups.io/mt/100212109/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-