]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c
MdeModulePkg/SdMmc: Avoid assigning 0 to the BlockSize of Trb
[mirror_edk2.git] / MdeModulePkg / Bus / Sd / SdBlockIoPei / SdHci.c
index 72efd56d4800ec329c2756e8dcc7bc2c40ae5f70..23e6563d499144f4fb3914ede68ab098fe0e372d 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2017, 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
@@ -1032,7 +1032,7 @@ SdPeimCreateTrb (
     goto Error;\r
   }\r
 \r
-  if (Trb->DataLen < Trb->BlockSize) {\r
+  if ((Trb->DataLen != 0) && (Trb->DataLen < Trb->BlockSize)) {\r
     Trb->BlockSize = (UINT16)Trb->DataLen;\r
   }\r
 \r