//\r
// For now, allocate an arbitrarily long buffer\r
//\r
+ BufferLen = 0;\r
Buffer = EfiLibAllocateZeroPool (0x10000);\r
if (Buffer == NULL) {\r
return 0;\r
\r
Handle = gST->ConsoleOutHandle;\r
\r
+ GraphicsOutput = NULL;\r
+ UgaDraw = NULL;\r
Status = gBS->HandleProtocol (\r
Handle,\r
&gEfiGraphicsOutputProtocolGuid,\r
(VOID**)&GraphicsOutput\r
);\r
\r
- UgaDraw = NULL;\r
- if (EFI_ERROR (Status)) {\r
+ if (EFI_ERROR (Status) || (GraphicsOutput == NULL)) {\r
GraphicsOutput = NULL;\r
\r
Status = gBS->HandleProtocol (\r
//\r
// For now, allocate an arbitrarily long buffer\r
//\r
+ BufferLen = 0;\r
Buffer = EfiLibAllocateZeroPool (0x10000);\r
if (Buffer == NULL) {\r
return 0;\r
\r
Handle = gST->ConsoleOutHandle;\r
\r
+ GraphicsOutput = NULL;\r
+ UgaDraw = NULL;\r
Status = gBS->HandleProtocol (\r
Handle,\r
&gEfiGraphicsOutputProtocolGuid,\r
(VOID **) &GraphicsOutput\r
);\r
\r
- UgaDraw = NULL;\r
- if (EFI_ERROR (Status)) {\r
+ if (EFI_ERROR (Status) || (GraphicsOutput == NULL)) {\r
GraphicsOutput = NULL;\r
\r
Status = gBS->HandleProtocol (\r
(VOID **) &UgaDraw\r
);\r
\r
- if (EFI_ERROR (Status) || (UgaDraw != NULL)) {\r
+ if (EFI_ERROR (Status) || (UgaDraw == NULL)) {\r
return 0;\r
}\r
}\r
(VOID **) &Sto\r
);\r
\r
- if (EFI_ERROR (Status) || (Sto != NULL)) {\r
+ if (EFI_ERROR (Status) || (Sto == NULL)) {\r
return 0;\r
}\r
\r
//\r
// TableBits should not be greater than 16.\r
//\r
- if (TableBits >= (sizeof (Count)/sizeof (UINT16))) {\r
+ if (TableBits > 16) {\r
return (UINT16) BAD_TABLE;\r
}\r
\r
//\r
// Count array index should not be greater than or equal to its size.\r
//\r
- if (BitLen[Index] < (sizeof (Count)/sizeof (UINT16))) {\r
+ if (BitLen[Index] <= 16) {\r
Count[BitLen[Index]]++;\r
} else {\r
return (UINT16) BAD_TABLE;\r
/*++\r
\r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
{\r
UINT8 Buffer;\r
\r
+ Buffer = 0;\r
EfiIoRead (EfiCpuIoWidthUint8, Address, 1, &Buffer);\r
return Buffer;\r
}\r
{\r
UINT16 Buffer;\r
\r
+ Buffer = 0;\r
EfiIoRead (EfiCpuIoWidthUint16, Address, 1, &Buffer);\r
return Buffer;\r
}\r
{\r
UINT32 Buffer;\r
\r
+ Buffer = 0;\r
EfiIoRead (EfiCpuIoWidthUint32, Address, 1, &Buffer);\r
return Buffer;\r
}\r
{\r
UINT8 Buffer;\r
\r
+ Buffer = 0;\r
EfiMemRead (EfiCpuIoWidthUint8, Address, 1, &Buffer);\r
return Buffer;\r
}\r
{\r
UINT16 Buffer;\r
\r
+ Buffer = 0;\r
EfiMemRead (EfiCpuIoWidthUint16, Address, 1, &Buffer);\r
return Buffer;\r
}\r
{\r
UINT32 Buffer;\r
\r
+ Buffer = 0;\r
EfiMemRead (EfiCpuIoWidthUint32, Address, 1, &Buffer);\r
return Buffer;\r
}\r
{\r
UINT64 Buffer;\r
\r
+ Buffer = 0;\r
EfiMemRead (EfiCpuIoWidthUint64, Address, 1, &Buffer);\r
return Buffer;\r
}\r