Skip to content

Commit

Permalink
NetworkPkg: fix CloseProtocol & UninstallMultipleProtocolInterfaces c…
Browse files Browse the repository at this point in the history
…alls

Both the "ControllerHandle" parameter of CloseProtocol() and the "Handle"
parameter of UninstallMultipleProtocolInterfaces() have type EFI_HANDLE,
not (EFI_HANDLE*).

This patch fixes actual bugs. The issues have been dormant likely because
they are on error paths. (Or, in case of TlsAuthConfigDxe, because the
driver is unloaded likely very infrequently.)

Cc: Jiaxin Wu <[email protected]>
Cc: Siyuan Fu <[email protected]>
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Siyuan Fu <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
  • Loading branch information
lersek committed Oct 9, 2019
1 parent c486a33 commit bf7249d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions NetworkPkg/DnsDxe/DnsDriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ Dns4ServiceBindingCreateChild (
DnsSb->ConnectUdp->UdpHandle,
&gEfiUdp4ProtocolGuid,
gDns4DriverBinding.DriverBindingHandle,
ChildHandle
*ChildHandle
);

gBS->UninstallMultipleProtocolInterfaces (
Expand Down Expand Up @@ -1388,7 +1388,7 @@ Dns6ServiceBindingCreateChild (
DnsSb->ConnectUdp->UdpHandle,
&gEfiUdp6ProtocolGuid,
gDns6DriverBinding.DriverBindingHandle,
ChildHandle
*ChildHandle
);

gBS->UninstallMultipleProtocolInterfaces (
Expand Down
2 changes: 1 addition & 1 deletion NetworkPkg/IScsiDxe/IScsiConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -3852,7 +3852,7 @@ IScsiConfigFormInit (
);
if (CallbackInfo->RegisteredHandle == NULL) {
gBS->UninstallMultipleProtocolInterfaces (
&CallbackInfo->DriverHandle,
CallbackInfo->DriverHandle,
&gEfiDevicePathProtocolGuid,
&mIScsiHiiVendorDevicePath,
&gEfiHiiConfigAccessProtocolGuid,
Expand Down
2 changes: 1 addition & 1 deletion NetworkPkg/Ip4Dxe/Ip4Driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ Ip4ServiceBindingCreateChild (
);
if (EFI_ERROR (Status)) {
gBS->UninstallMultipleProtocolInterfaces (
ChildHandle,
*ChildHandle,
&gEfiIp4ProtocolGuid,
&IpInstance->Ip4Proto,
NULL
Expand Down
2 changes: 1 addition & 1 deletion NetworkPkg/Ip6Dxe/Ip6Driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ Ip6ServiceBindingCreateChild (
);
if (EFI_ERROR (Status)) {
gBS->UninstallMultipleProtocolInterfaces (
ChildHandle,
*ChildHandle,
&gEfiIp6ProtocolGuid,
&IpInstance->Ip6Proto,
NULL
Expand Down
2 changes: 1 addition & 1 deletion NetworkPkg/Mtftp4Dxe/Mtftp4Driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ Mtftp4ServiceBindingCreateChild (
MtftpSb->ConnectUdp->UdpHandle,
&gEfiUdp4ProtocolGuid,
gMtftp4DriverBinding.DriverBindingHandle,
ChildHandle
*ChildHandle
);
goto ON_ERROR;
}
Expand Down
2 changes: 1 addition & 1 deletion NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TlsAuthConfigDxeUnload (
ASSERT (PrivateData->Signature == TLS_AUTH_CONFIG_PRIVATE_DATA_SIGNATURE);

gBS->UninstallMultipleProtocolInterfaces (
&ImageHandle,
ImageHandle,
&gEfiCallerIdGuid,
PrivateData,
NULL
Expand Down

0 comments on commit bf7249d

Please sign in to comment.