diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c index ccbf355016..aa75aa8d24 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c @@ -4,7 +4,7 @@ It would expose EFI_SD_MMC_PASS_THRU_PROTOCOL for upper layer use. - Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1265,7 +1265,7 @@ SdMmcCreateTrb ( goto Error; } - if (Trb->DataLen < Trb->BlockSize) { + if ((Trb->DataLen != 0) && (Trb->DataLen < Trb->BlockSize)) { Trb->BlockSize = (UINT16)Trb->DataLen; } diff --git a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c index 5a9e0b2f14..2c0baca3e3 100644 --- a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c +++ b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1032,7 +1032,7 @@ EmmcPeimCreateTrb ( goto Error; } - if (Trb->DataLen < Trb->BlockSize) { + if ((Trb->DataLen != 0) && (Trb->DataLen < Trb->BlockSize)) { Trb->BlockSize = (UINT16)Trb->DataLen; } diff --git a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c index 72efd56d48..23e6563d49 100644 --- a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c +++ b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1032,7 +1032,7 @@ SdPeimCreateTrb ( goto Error; } - if (Trb->DataLen < Trb->BlockSize) { + if ((Trb->DataLen != 0) && (Trb->DataLen < Trb->BlockSize)) { Trb->BlockSize = (UINT16)Trb->DataLen; }