[edk2-devel] [PATCH] [PATCH]MdeModulePkg/Ufs: Coverity scan flags multiple issues in edk2-stable202205 Signed-off-by: sivaparvathic@ami.com

sivaparvathi C via groups.io posted 1 patch 1 week, 2 days ago
Failed in applying to current master (apply log)
MdeModulePkg/Bus/Ufs/UfsBlockIoPei/DmaMem.c   | 18 ++++++++++++------
MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHcMem.c |  3 +++
2 files changed, 15 insertions(+), 6 deletions(-)
[edk2-devel] [PATCH] [PATCH]MdeModulePkg/Ufs: Coverity scan flags multiple issues in edk2-stable202205 Signed-off-by: sivaparvathic@ami.com
Posted by sivaparvathi C via groups.io 1 week, 2 days ago
---
 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 =   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/Bus/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 != NULL);



+  if (Block == 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 proprietary 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 designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. 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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92040): https://edk2.groups.io/g/devel/message/92040
Mute This Topic: https://groups.io/mt/92765057/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-