\r
DevicePath = AppendDevicePathNode (AtaBusDriverData->ParentDevicePath, NewDevicePathNode);\r
if (DevicePath == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
goto Done;\r
}\r
\r
DeviceHandle = NULL;\r
+ RemainingDevicePath = DevicePath;\r
Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &DeviceHandle);\r
if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) {\r
Status = EFI_ALREADY_STARTED;\r
+ FreePool (DevicePath);\r
goto Done;\r
}\r
\r