]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg SdBlockIoPei: Initialize 'SwitchResp' elements before using
authorHao Wu <hao.a.wu@intel.com>
Thu, 7 Jul 2016 06:53:58 +0000 (14:53 +0800)
committerHao Wu <hao.a.wu@intel.com>
Mon, 11 Jul 2016 00:59:53 +0000 (08:59 +0800)
The commit makes sure that the elements in array 'SwitchResp' get
initialized before being used.

Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c

index c251fbecb334978390f086dac31f4f47a8f86d0a..72efd56d4800ec329c2756e8dcc7bc2c40ae5f70 100644 (file)
@@ -2647,6 +2647,7 @@ SdPeimSetBusMode (
   //\r
   // Get the supported bus speed from SWITCH cmd return data group #1.\r
   //\r
+  ZeroMem (SwitchResp, sizeof (SwitchResp));\r
   Status = SdPeimSwitch (Slot, 0xF, 0xF, 0xF, 0xF, FALSE, SwitchResp);\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r