summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-10 05:01:15 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-10 05:01:15 +0000
commite70ae46c0009d8e51b184aacf09817748082cce6 (patch)
tree51f4b6b4209b80cd63d3361a8c0552e487d835e8 /MdeModulePkg
parent487ef018038fa782571bfa5f07a9362e86d1c17b (diff)
downloadedk2-platforms-e70ae46c0009d8e51b184aacf09817748082cce6.tar.xz
fix null DevicePath issue.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11360 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
index 875baa88b0..6b8257e1b6 100644
--- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
+++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
@@ -193,13 +193,16 @@ RegisterAtaDevice (
DevicePath = AppendDevicePathNode (AtaBusDriverData->ParentDevicePath, NewDevicePathNode);
if (DevicePath == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
goto Done;
}
DeviceHandle = NULL;
+ RemainingDevicePath = DevicePath;
Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &DeviceHandle);
if (!EFI_ERROR (Status) && (DeviceHandle != NULL) && IsDevicePathEnd(RemainingDevicePath)) {
Status = EFI_ALREADY_STARTED;
+ FreePool (DevicePath);
goto Done;
}