- DevicePathNode.DevPath = RemainingDevicePath;\r
-\r
- if ((DevicePathNode.DevPath->Type != MESSAGING_DEVICE_PATH) ||\r
- (DevicePathNode.DevPath->SubType != MSG_USB_DP &&\r
- DevicePathNode.DevPath->SubType != MSG_USB_CLASS_DP\r
- && DevicePathNode.DevPath->SubType != MSG_USB_WWID_DP\r
- )) {\r
-\r
- return EFI_UNSUPPORTED;\r
+ //\r
+ // Check if RemainingDevicePath is the End of Device Path Node, \r
+ // if yes, go on checking other conditions\r
+ //\r
+ if (!IsDevicePathEnd (RemainingDevicePath)) {\r
+ //\r
+ // If RemainingDevicePath isn't the End of Device Path Node,\r
+ // check its validation\r
+ //\r
+ DevicePathNode.DevPath = RemainingDevicePath;\r
+ \r
+ if ((DevicePathNode.DevPath->Type != MESSAGING_DEVICE_PATH) ||\r
+ (DevicePathNode.DevPath->SubType != MSG_USB_DP &&\r
+ DevicePathNode.DevPath->SubType != MSG_USB_CLASS_DP\r
+ && DevicePathNode.DevPath->SubType != MSG_USB_WWID_DP\r
+ )) {\r
+ \r
+ return EFI_UNSUPPORTED;\r
+ }\r