Revision: 19266
http://sourceforge.net/p/edk2/code/19266
Author: hwu1225
Date: 2015-12-15 05:43:08 +0000 (Tue, 15 Dec 2015)
Log Message:
-----------
MdeModulePkg UfsPassThru: ASSERT if params are NULL in SignalCallerEvent
In function SignalCallerEvent(), 'Private' and 'TransReq' are dereferenced
before NULL checking.
Since the function assumes that both 'Private' and 'TransReq' passed in
are not NULL pointer, this commit will add an ASSERT to make sure the
above assumption is satisfied.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <[email protected]>
Reviewed-by: Feng Tian <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
Modified: trunk/edk2/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
2015-12-15 04:59:37 UTC (rev 19265)
+++ trunk/edk2/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
2015-12-15 05:43:08 UTC (rev 19266)
@@ -2191,6 +2191,8 @@
EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHc;
EFI_EVENT CallerEvent;
+ ASSERT ((Private != NULL) && (TransReq != NULL));
+
UfsHc = Private->UfsHostController;
CallerEvent = TransReq->CallerEvent;
@@ -2214,10 +2216,9 @@
TransReq->CmdDescHost
);
}
- if (TransReq != NULL) {
- FreePool (TransReq);
- }
+ FreePool (TransReq);
+
gBS->SignalEvent (CallerEvent);
return;
}
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits