From e70ae46c0009d8e51b184aacf09817748082cce6 Mon Sep 17 00:00:00 2001 From: erictian Date: Thu, 10 Mar 2011 05:01:15 +0000 Subject: [PATCH 1/1] fix null DevicePath issue. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11360 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.39.2