Revision: 16555
          http://sourceforge.net/p/edk2/code/16555
Author:   niruiyu
Date:     2014-12-23 09:56:33 +0000 (Tue, 23 Dec 2014)
Log Message:
-----------
Do not assert when the device path node length is invalid.

Because IsDevicePathValid() calls this API we should leave the device path 
validation in the caller.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    
trunk/edk2/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c

Modified: 
trunk/edk2/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
===================================================================
--- 
trunk/edk2/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
   2014-12-23 08:35:20 UTC (rev 16554)
+++ 
trunk/edk2/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
   2014-12-23 09:56:33 UTC (rev 16555)
@@ -2,7 +2,7 @@
   Library instance that implement UEFI Device Path Library class based on 
protocol
   gEfiDevicePathUtilitiesProtocolGuid.
 
-  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
   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
@@ -195,12 +195,8 @@
   IN CONST VOID  *Node
   )
 {
-  UINTN Length;
-
   ASSERT (Node != NULL);
-  Length = ReadUnaligned16 ((UINT16 *)&((EFI_DEVICE_PATH_PROTOCOL 
*)(Node))->Length[0]);
-  ASSERT (Length >= sizeof (EFI_DEVICE_PATH_PROTOCOL));
-  return Length;
+  return ReadUnaligned16 ((UINT16 *)&((EFI_DEVICE_PATH_PROTOCOL 
*)(Node))->Length[0]);
 }
 
 /**
@@ -567,8 +563,7 @@
   If there is not enough memory to allocate space for the new device path, 
then 
   NULL is returned.  
   The memory is allocated from EFI boot services memory. It is the 
responsibility 
-  of the caller to
-  free the memory allocated.
+  of the caller to free the memory allocated.
 
   @param  NodeType                   The device node type for the new device 
node.
   @param  NodeSubType                The device node sub-type for the new 
device node.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to