Initialize data before using it

Signed-off-by: ydong10
Reviewed-by: lgao4


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11869 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2011-06-21 02:24:46 +00:00
parent ea203f2215
commit 18ad26da31
2 changed files with 12 additions and 1 deletions

View File

@ -38,6 +38,8 @@ IoReadWorker (
SAL_RETURN_REGS ReturnReg; SAL_RETURN_REGS ReturnReg;
UINT64 Data; UINT64 Data;
Data = 0;
ReturnReg = EsalCall ( ReturnReg = EsalCall (
EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO, EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO,
EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI, EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI,
@ -119,6 +121,8 @@ MmioReadWorker (
SAL_RETURN_REGS ReturnReg; SAL_RETURN_REGS ReturnReg;
UINT64 Data; UINT64 Data;
Data = 0;
ReturnReg = EsalCall ( ReturnReg = EsalCall (
EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO, EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_LO,
EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI, EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID_HI,

View File

@ -60,6 +60,14 @@ SalCall (
{ {
SAL_RETURN_REGS Regs; SAL_RETURN_REGS Regs;
//
// Initial all members in this structure.
//
Regs.r9 = 0;
Regs.r10 = 0;
Regs.r11 = 0;
Regs.Status = EFI_SAL_INVALID_ARGUMENT;
switch (Index) { switch (Index) {
case EFI_SAL_SET_VECTORS: case EFI_SAL_SET_VECTORS:
return EsalCall ( return EsalCall (
@ -272,7 +280,6 @@ SalCall (
break; break;
default: default:
Regs.Status = EFI_SAL_INVALID_ARGUMENT;
return Regs; return Regs;
break; break;
} }