]> git.proxmox.com Git - mirror_edk2.git/commitdiff
fix null DevicePath issue.
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Mar 2011 05:01:15 +0000 (05:01 +0000)
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Mar 2011 05:01:15 +0000 (05:01 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11360 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c

index 875baa88b059ba00536df2e19901fbb1d2d06bf5..6b8257e1b6d42961ec674aa176c26b7cda67882d 100644 (file)
@@ -193,13 +193,16 @@ RegisterAtaDevice (
 \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