mirror of https://github.com/acidanthera/audk.git
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:
parent
6d896ff1cb
commit
86702b3fa9
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue