X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellDebug1CommandsLib%2FMm.c;h=26a758b6cdd75f2379a3a7da11b9ffe9250c4372;hb=0ab90add0f525eb9c91ce4bc2357298c4f357d09;hp=7b26e4d27f6e3eb3250a91c029b88302eb4a8c52;hpb=02d3482574ed2b0b5435563c234563bea2167634;p=mirror_edk2.git diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c index 7b26e4d27f..26a758b6cd 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c @@ -329,6 +329,8 @@ ShellMmLocateIoProtocol ( return FALSE; } + Segment = 0; + Bus = 0; if ((AccessType == ShellMmPci) || (AccessType == ShellMmPciExpress)) { ShellMmDecodePciAddress ((BOOLEAN) (AccessType == ShellMmPci), Address, &Segment, &Bus, NULL, NULL, NULL); } @@ -615,18 +617,18 @@ ShellCommandRunMm ( // skip space characters // for (Index = 0; InputStr[Index] == ' '; Index++); - } - if ((InputStr != NULL) && (InputStr[Index] != CHAR_NULL)) { - if ((InputStr[Index] == '.') || (InputStr[Index] == 'q') || (InputStr[Index] == 'Q')) { - Complete = TRUE; - } else if (!EFI_ERROR (ShellConvertStringToUint64 (InputStr + Index, &Buffer, TRUE, TRUE)) && - (Buffer <= mShellMmMaxNumber[Size]) - ) { - ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, Address, Size, &Buffer); - } else { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR), gShellDebug1HiiHandle, L"mm"); - continue; + if (InputStr[Index] != CHAR_NULL) { + if ((InputStr[Index] == '.') || (InputStr[Index] == 'q') || (InputStr[Index] == 'Q')) { + Complete = TRUE; + } else if (!EFI_ERROR (ShellConvertStringToUint64 (InputStr + Index, &Buffer, TRUE, TRUE)) && + (Buffer <= mShellMmMaxNumber[Size]) + ) { + ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, Address, Size, &Buffer); + } else { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR), gShellDebug1HiiHandle, L"mm"); + continue; + } } }