DuetPkg/SataController: Fix possible memory leak at error handling of SataController driver

Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jie Lin <jie.lin@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13482 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
erictian 2012-07-03 03:24:47 +00:00
parent 6d896ff1cb
commit 86702b3fa9
1 changed files with 2 additions and 0 deletions

View File

@ -920,6 +920,7 @@ IdeInitCalculateMode (
*SupportedModes = AllocateZeroPool (sizeof (EFI_ATA_COLLECTIVE_MODE));
if (*SupportedModes == NULL) {
ASSERT (*SupportedModes != NULL);
return EFI_OUT_OF_RESOURCES;
}
@ -931,6 +932,7 @@ IdeInitCalculateMode (
// Make sure we've got the valid identify data of the device from SubmitData()
//
if (!IdentifyValid) {
FreePool (*SupportedModes);
return EFI_NOT_READY;
}