From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.41]) by mx.groups.io with SMTP id smtpd.web12.2313.1659412912413605841 for ; Mon, 01 Aug 2022 21:01:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ami.com header.s=selector1 header.b=V+utOeQx; spf=pass (domain: ami.com, ip: 40.107.96.41, mailfrom: sivaparvathic@ami.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FkptaYLjcWZ8MOA7m/01T2r+cgocC2KJEOowLYGpBmAr1LpB0ub51JXbxm4XDGZ9ODDbfWsT+HmW9Byj15EajRSMYeNdUW1ic/LuVZTQ/R7ZoxXYRDUGXMHdZnYC20CMyd6F6YSMCc6pkebJVSL4nywmrbSwQV58xRrYL8mB9NqkLMJpVv7oq4kzAuyG5EpRnHIIOAkbge9eCbnBB3Qmjtcje1DRS6WRoWLesH7zvKNAC0QQQhZo45vzaSIQcuhYOUMmXW9L+kC+AWLEEX6P1Mj8q5/Kk7QW2Dh6LND5kZwcU7JqQR2yne3jRkEcu8Zt323PTeRPJN4kfVaBb4o8AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rF0oZP9hUijCOhOjC2s2WTG7azh1BQW1uLHOlM6lHSU=; b=BfppgVqdun0TcODZ9DaJ3I0qc0vzRSMksw9FvkwSFcf6BGtGeoa+3vL/PGDy7NnZ5f/5ZKeVnSyPvG4FgWYE3IDuWLoTTphGFVg8dKlgYHZyePWjFWZFzdLgPO/eRqc/znhGyiHx1vQax7Mq7/rq4v0fqrx5LZy44bjZhY1KN2t2it+9eqE+Ek+bwUOFqCfoTScOi7aN2ClEn8rj23akV9NxN/ZBKY/s0yW6zMId6vR27WOr50U6rBkS5OO0ltoTCTDzXSQeqpOhUyc7XLFU42Q1Gpse9gEQQYdP67pnJLFv7geRNeCDILj7pWM067fg8aPV4jOc1GPzp/ByNL1JcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ami.com; dmarc=pass action=none header.from=ami.com; dkim=pass header.d=ami.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ami.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rF0oZP9hUijCOhOjC2s2WTG7azh1BQW1uLHOlM6lHSU=; b=V+utOeQxnjj3TJe2znQj5fSZVt3K2tWGPuCz7bcbmOGS/PB/PV5RtPZFxkdhaj5cUiUbffr/lI45BG5h8Jib33OPf0W+ckveh1DQ2Qq4CSwiCL3navJYgvClUxHNYlyz+hqidMIW7Y2bkSbaz6Nl/m2XzAN5BY7pQGVMKj32OUY= Received: from DS7PR10MB5040.namprd10.prod.outlook.com (2603:10b6:5:3b0::8) by CY4PR10MB1381.namprd10.prod.outlook.com (2603:10b6:903:29::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.12; Tue, 2 Aug 2022 04:01:48 +0000 Received: from DS7PR10MB5040.namprd10.prod.outlook.com ([fe80::78f7:67f1:2606:e2c4]) by DS7PR10MB5040.namprd10.prod.outlook.com ([fe80::78f7:67f1:2606:e2c4%3]) with mapi id 15.20.5482.016; Tue, 2 Aug 2022 04:01:48 +0000 From: "sivaparvathi C" To: "devel@edk2.groups.io" , Sivaparvathi Chellaiah CC: Vasudevan Sambandan , Sundaresan S Subject: [PATCH] [PATCH]MdeModulePkg/Ufs: Coverity scan flags multiple issues in edk2-stable202205 Signed-off-by: sivaparvathic@ami.com Thread-Topic: [PATCH] [PATCH]MdeModulePkg/Ufs: Coverity scan flags multiple issues in edk2-stable202205 Signed-off-by: sivaparvathic@ami.com Thread-Index: AQHYpiSWqWH8Biw/w0Cx4eK2HpvD9Q== Date: Tue, 2 Aug 2022 04:01:48 +0000 Message-ID: <20220802040020.631-1-sivaparvathic@ami.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ami.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 773ff272-f09a-4baa-2145-08da743bb95a x-ms-traffictypediagnostic: CY4PR10MB1381:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YQRgf/qxXbpfh7Ofj8CWzw4zs+/DQJsdJXUIm7A1dpa7KfSuj5T6A5FyyiZcRluw8TF/c0CoqJ8acwrpUwAzPAGGCoTKJ+NnLX1h76cDoeBpAaXbgvBw1HBIezlvvJCuWqHhl2DVhdi69XNJvz5Bs0ISnuRxBcFZZJL4xJz5KhplGJgT8WmXJcjKpC/9TIakC4mNumWUIwlAwRgCS/bkPtCa2HvScTltJVcEEsA3NCLa/4/nsX6KIKY1Iymsu6/qv/d/Dxac5VSaHwvGlomlo+R1oX0d9R2KTVL1Iw6gLbwNdcB10uIpx3vDS1st6Cew+tc0mWPk8CHU8ZGWBR3UMqrlQ94g5DSKs8kk7J0csClWFG5V+UNWzW/DFPU1vlonWZ8zVaG0DRpnltXyNqDgO+BDRSLqApQRiYZMy2vsFaor8yW27i7c4gNxf+9/4+pl6OmgkMrdbsg+SsDYsY5B8ryIkobS22TRDv/qbcszqc4k97N6N21UplPvmsS5vCCZ5Org6s3I6xWVxUTQYkrlRiU4kd6NwURArqs7GpsRht87PMrNTYeF3Nwh1xS+I20u8m6Rs1UkdgVo7N4j8Nyzu/2oaMqgt2Fa249iII6Avxh91ctsmBT3BVbvp8rPxVoXMy6YzLCbb0FEE/o5NUklqcQs7Qcfwari4PmCVLDSfS/TyV+9xh9K2ogAn3LqZvG7UVNk7/PhBt+O4RMDFap9znVp3nBrLE13mwkofoBWFR9/fELjy8L5iI68NIwLMAObC6KKyBsPp0hv7FLVT5bVMZUkPaY1urzIigpfzzEIUES1RP8lHhF1ix5jJ9wLnz12d0CikMxrp+V4M6WpdXPL6w== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5040.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(136003)(366004)(396003)(376002)(39850400004)(71200400001)(36756003)(38070700005)(91956017)(7049001)(41300700001)(2906002)(76116006)(66446008)(2616005)(1076003)(186003)(64756008)(66476007)(66556008)(66946007)(83380400001)(316002)(8676002)(4326008)(6486002)(478600001)(6512007)(86362001)(6506007)(38100700002)(8936002)(5660300002)(40140700001)(54906003)(122000001)(26005)(110136005)(220923002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?CSBd12sIF0kBaZQeYSpAlyarpuP6m5hg5dsQ1jEG0ZmcEtWgskfabvuk0O?= =?iso-8859-1?Q?LNWdYg7LiDCj9doXY8Lejh7hAXib4ssYtOkBIji3B0NFjXIuOMh7TqXBeZ?= =?iso-8859-1?Q?A83HV8zHkdxB1YcsFziH305bQ2i8psAQ3NZ8u0r8uKysDteJ7vw5ZSZEdx?= =?iso-8859-1?Q?DfP10zBKJw8Y6dC7WY6grYP0KPgY7awyegDOdPxJCLoO3bPJYElmTedNEt?= =?iso-8859-1?Q?xdS1rKVALEVcidpxYxFufU7RmfhmaVgeLxCpCXAfvYlsqRN4+8dkA84mHn?= =?iso-8859-1?Q?mTbCckFGXxfW2X24DwdAiHzXvYqYXTIT7J1CV4b4hPk/B+zkOXRK8i/qdV?= =?iso-8859-1?Q?32dznD6FMMEhBi/7vA/x4/mTag3SpNTd7O7QB3rINYX5+kagMpj9Lpo1Dc?= =?iso-8859-1?Q?2stBnwfLANDqx3dJEAIk2Lj68VX3P6f5ERdvxYcaw79OIzdIGQs/Zlb4fy?= =?iso-8859-1?Q?bDBN6YPabncAnSfjwBPQrCJUeevE6z48f3BODkPIABGjKr0mKrlg7WgJKM?= =?iso-8859-1?Q?Zxz+psnbCAx9SnqtYA/R/7S45iBmbANq82bkh2+vmxWyM7AzCT51hTlEw7?= =?iso-8859-1?Q?Eiiij8496qcMe66TCYygC2mrop52zUA2EutINGDWa6tio3T/AnWv3/OmmL?= =?iso-8859-1?Q?S1Cs+IDog9b1kAp3fbpp6CIDNR/4v2hik8n98TD++ii6iUDGTm3FQAI0N2?= =?iso-8859-1?Q?jVZeYDZwJfnnXQLtZx0hWPWErvn28QtEMIOutmN3BegxkUKgJRjzqjuj7Q?= =?iso-8859-1?Q?+o16CQueEcqvWZWMSLP8lvaCxFooOSYRMtW7gEoEC989N5HLBXzpwaTsXF?= =?iso-8859-1?Q?TzAdFyLbgGtUOlqPoeaJaklx6cpkL529XEa/VmYGB6u/ikGX8BpnSc/51m?= =?iso-8859-1?Q?o1tAhqucHPXB/8Wr1ebh3fk4hN+07XkIcQjxQEl+3p+z0/f19mbjb7Ifsj?= =?iso-8859-1?Q?2j0DdSXtNeTPUO6K0VhQvU3s3HH68vEeWPEMNepIuApi+XaprzE6lnWJ+E?= =?iso-8859-1?Q?LmdQPmsDfORlSHWL+eJdOTIipWGe/j5srydeUZp+yKDZ/GVc5N4R0LOG3V?= =?iso-8859-1?Q?NGt3NtoAnukLEYuITtH468h4sSA7Jho9R54iHAeoqjyPvWeweTL71vFjh1?= =?iso-8859-1?Q?SX5u1yxBpks208H7egXNOuzNUiLT261VBJ52ecCob8KgfOrwslU34yx25G?= =?iso-8859-1?Q?X7D6SffcAEUBGvCmjJAGAJ0Tj4k5zWzlvQV9bMF10R42ccN8kr7AJGccX+?= =?iso-8859-1?Q?57MhZMnlQTCd7T37HZdg4HzpX/fu1E3Y4w7YrmrvkZluUG/bB2bRCj8Ewq?= =?iso-8859-1?Q?ilhb0FNI7SmBQDGyVUMM8AyIsQY1neJ5wTYlRTtOeoEA4LQzyLgXz4qmll?= =?iso-8859-1?Q?++obQyuPrSvDdt1GEQvaXGCsfEnl6ggFuMaqCbyTN5AaAhH/7rldvh3C7w?= =?iso-8859-1?Q?9QfumMB3eZam+wiRHHj7iehNFfmHUW8gCnJfZTTLEi/c/BHfusORu/gDDY?= =?iso-8859-1?Q?azzZhIi5x9RFXbkeSpOvaMjQpGkBkXOx7+caFeRZ6P0Gsz/QB4q8t39h0N?= =?iso-8859-1?Q?AWRykZVd2Qe+YZdul+3zSOYZk3oOGPhb2L6sryMc0wtIu1n+qUXuDNHCEO?= =?iso-8859-1?Q?dg/bugsENEec3y0aPhy14g5gb/FRvE/6D8m9gEmgVw9JFT17m0HdEd4Q?= =?iso-8859-1?Q?=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5040.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 773ff272-f09a-4baa-2145-08da743bb95a X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2022 04:01:48.7462 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 27e97857-e15f-486c-b58e-86c2b3040f93 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vYdVP0ecEmGXYmsbI+R+mDizUORp8pqC9jS+9iacNsi1Qejvh4jkTmdmrfbal7Clh0uiZC3Cd+aN9cJKwhPvlw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1381 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable --- MdeModulePkg/Bus/Ufs/UfsBlockIoPei/DmaMem.c | 18 ++++++++++++------ MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c | 3 +++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/DmaMem.c b/MdeModulePkg/Bus= /Ufs/UfsBlockIoPei/DmaMem.c index 62aeaf86c8..b4b0f07d5e 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/DmaMem.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/DmaMem.c @@ -240,10 +240,16 @@ IoMmuInit ( VOID ) { - PeiServicesLocatePpi ( - &gEdkiiIoMmuPpiGuid, - 0, - NULL, - (VOID **)&mIoMmu - ); + EFI_STATUS Status; + + Status =3D PeiServicesLocatePpi ( + &gEdkiiIoMmuPpiGuid, + 0, + NULL, + (VOID **)&mIoMmu + ); + + if (EFI_ERROR(Status)) { + DEBUG ((DEBUG_INFO, "Locate mIoMmu Ppi is failed!!!\n")); + } } diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c b/MdeModulePkg/B= us/Ufs/UfsBlockIoPei/UfsHcMem.c index b7dd9b6acd..b5f0324908 100644 --- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c +++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c @@ -414,6 +414,9 @@ UfsPeimFreeMem ( // ASSERT (Block !=3D NULL); + if (Block =3D=3D NULL) { + return; + } // // Release the current memory block if it is empty and not the head // -- 2.31.0.windows.1 -The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephone= at 770-246-8600, and then delete or destroy all copies of the transmission= .