summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/HttpBootDxe/HttpBootDxe.c
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/HttpBootDxe/HttpBootDxe.c')
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootDxe.c50
1 files changed, 27 insertions, 23 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.c b/NetworkPkg/HttpBootDxe/HttpBootDxe.c
index b1f9042ea3..8a61f51cc8 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootDxe.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.c
@@ -615,19 +615,21 @@ HttpBootIp4DxeDriverBindingStart (
return EFI_SUCCESS;
ON_ERROR:
- if (FirstStart) {
- gBS->UninstallProtocolInterface (
- ControllerHandle,
- &gEfiCallerIdGuid,
- &Private->Id
- );
- }
-
- HttpBootDestroyIp4Children (This, Private);
- HttpBootConfigFormUnload (Private);
+ if (Private != NULL) {
+ if (FirstStart) {
+ gBS->UninstallProtocolInterface (
+ ControllerHandle,
+ &gEfiCallerIdGuid,
+ &Private->Id
+ );
+ }
+
+ HttpBootDestroyIp4Children (This, Private);
+ HttpBootConfigFormUnload (Private);
- if (FirstStart && Private != NULL) {
- FreePool (Private);
+ if (FirstStart) {
+ FreePool (Private);
+ }
}
return Status;
@@ -1144,19 +1146,21 @@ HttpBootIp6DxeDriverBindingStart (
return EFI_SUCCESS;
ON_ERROR:
- if (FirstStart) {
- gBS->UninstallProtocolInterface (
- ControllerHandle,
- &gEfiCallerIdGuid,
- &Private->Id
- );
- }
+ if (Private != NULL) {
+ if (FirstStart) {
+ gBS->UninstallProtocolInterface (
+ ControllerHandle,
+ &gEfiCallerIdGuid,
+ &Private->Id
+ );
+ }
- HttpBootDestroyIp6Children(This, Private);
- HttpBootConfigFormUnload (Private);
+ HttpBootDestroyIp6Children(This, Private);
+ HttpBootConfigFormUnload (Private);
- if (FirstStart && Private != NULL) {
- FreePool (Private);
+ if (FirstStart) {
+ FreePool (Private);
+ }
}
return Status;