Potentially uninitialized 'Status' might be returned in functions
NvmeCreateIoCompletionQueue() and NvmeCreateIoSubmissionQueue() in file
NvmExpressHci.c.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <[email protected]>
---
 MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c 
b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
index dcfe1e8..09e8263 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
@@ -684,7 +684,7 @@ NvmeCreateIoCompletionQueue (
   NVME_ADMIN_CRIOCQ                        CrIoCq;
   UINT32                                   Index;
 
-  for (Index = 1; Index < NVME_MAX_QUEUES; Index++) {
+  for (Index = 1, Status = EFI_SUCCESS; Index < NVME_MAX_QUEUES; Index++) {
     ZeroMem (&CommandPacket, sizeof(EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET));
     ZeroMem (&Command, sizeof(EFI_NVM_EXPRESS_COMMAND));
     ZeroMem (&Completion, sizeof(EFI_NVM_EXPRESS_COMPLETION));
@@ -740,7 +740,7 @@ NvmeCreateIoSubmissionQueue (
   NVME_ADMIN_CRIOSQ                        CrIoSq;
   UINT32                                   Index;
 
-  for (Index = 1; Index < NVME_MAX_QUEUES; Index++) {
+  for (Index = 1, Status = EFI_SUCCESS; Index < NVME_MAX_QUEUES; Index++) {
     ZeroMem (&CommandPacket, sizeof(EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET));
     ZeroMem (&Command, sizeof(EFI_NVM_EXPRESS_COMMAND));
     ZeroMem (&Completion, sizeof(EFI_NVM_EXPRESS_COMPLETION));
-- 
1.9.5.msysgit.0

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to