diff options
author | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-05-17 08:32:05 +0000 |
---|---|---|
committer | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-05-17 08:32:05 +0000 |
commit | f0c855b26386c16ba0a70600d72cd09c090db0e0 (patch) | |
tree | 14527b04cad3e48d713e7577f02a595eb7b1b1b2 /MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c | |
parent | 0e4483bc69aa31f1facbe62af438fa4feaf4503a (diff) | |
download | edk2-platforms-f0c855b26386c16ba0a70600d72cd09c090db0e0.tar.xz |
Small code refinement in MdeModulePkg.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10492 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c')
-rw-r--r-- | MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c index ff9e4b2179..e490ca45d8 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -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;
}
|