Small code refinement in MdeModulePkg.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10492 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
rsun3
2010-05-17 08:32:05 +00:00
parent 0e4483bc69
commit f0c855b263
4 changed files with 70 additions and 89 deletions

View File

@@ -1433,6 +1433,9 @@ DriverSampleUnload (
)
{
UINTN Index;
ASSERT (PrivateData != NULL);
if (DriverHandle[0] != NULL) {
gBS->UninstallMultipleProtocolInterfaces (
DriverHandle[0],
@@ -1463,15 +1466,13 @@ DriverSampleUnload (
HiiRemovePackages (PrivateData->HiiHandle[1]);
}
if (PrivateData != NULL) {
for (Index = 0; Index < NAME_VALUE_NAME_NUMBER; Index++) {
if (PrivateData->NameValueName[Index] != NULL) {
FreePool (PrivateData->NameValueName[Index]);
}
for (Index = 0; Index < NAME_VALUE_NAME_NUMBER; Index++) {
if (PrivateData->NameValueName[Index] != NULL) {
FreePool (PrivateData->NameValueName[Index]);
}
FreePool (PrivateData);
PrivateData = NULL;
}
FreePool (PrivateData);
PrivateData = NULL;
return EFI_SUCCESS;
}