Hi, Guo

It's not a bug, for EfiPxeLoadFile function the input FilePath should always be 
an end device path node.


-----Original Message-----
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Heyi Guo
Sent: Friday, November 20, 2015 4:23 PM
To: edk2-devel@lists.01.org
Cc: Zhang, Lubo <lubo.zh...@intel.com>; Heyi Guo <heyi....@linaro.org>; Tian, 
Feng <feng.t...@intel.com>
Subject: [edk2] [PATCH] MdeModulePkg/Pxe: Fix bug of checking input FilePath

There is a simple bug in below code and will cause PXE always returning invalid 
parameter:

  if (FilePath == NULL || !IsDevicePathEnd (FilePath)) {
    return EFI_INVALID_PARAMETER;

FilePath should *not* be end node, so return invalid parameter when FilePath 
*is* device path end.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi....@linaro.org>
Cc: Feng Tian <feng.t...@intel.com>
Cc: Zhang Lubo <lubo.zh...@intel.com>
---
 MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c 
b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
index 89977e6..1c7b664 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
@@ -2776,7 +2776,7 @@ EfiPxeLoadFile (
   UINT64                      TmpBufSize;
   BOOLEAN                     MediaPresent;
 
-  if (FilePath == NULL || !IsDevicePathEnd (FilePath)) {
+  if (FilePath == NULL || IsDevicePathEnd (FilePath)) {
     return EFI_INVALID_PARAMETER;
   }
   
--
2.6.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to