diff options
author | Hao Wu <hao.a.wu@intel.com> | 2015-12-15 05:43:08 +0000 |
---|---|---|
committer | hwu1225 <hwu1225@Edk2> | 2015-12-15 05:43:08 +0000 |
commit | 33e2ba78eeaa9b56f27b7174d66ca5180832623b (patch) | |
tree | 2c271fa9bafbf54456b9e3b121de853bf29ba9f3 /MdeModulePkg | |
parent | 8e59d39524d6bf4108bb3e7f17305e189a59e08b (diff) | |
download | edk2-33e2ba78eeaa9b56f27b7174d66ca5180832623b.tar.gz edk2-33e2ba78eeaa9b56f27b7174d66ca5180832623b.tar.bz2 edk2-33e2ba78eeaa9b56f27b7174d66ca5180832623b.zip |
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 <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19266 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 7 |
1 files changed, 4 insertions, 3 deletions
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;
|