diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c index 4fbe199390..81653af5a8 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -2191,6 +2191,8 @@ SignalCallerEvent ( EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHc; EFI_EVENT CallerEvent; + ASSERT ((Private != NULL) && (TransReq != NULL)); + UfsHc = Private->UfsHostController; CallerEvent = TransReq->CallerEvent; @@ -2214,9 +2216,8 @@ SignalCallerEvent ( TransReq->CmdDescHost ); } - if (TransReq != NULL) { - FreePool (TransReq); - } + + FreePool (TransReq); gBS->SignalEvent (CallerEvent); return;