diff options
author | Star Zeng <star.zeng@intel.com> | 2015-10-28 00:48:43 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@Edk2> | 2015-10-28 00:48:43 +0000 |
commit | ae658d9163afd6053db7d37d46f54388e33a0052 (patch) | |
tree | 093c8ab2828670876d728d63497bbb060da88f51 | |
parent | 5b5e5674ae59721d4e045401c2deaaa76a96cda6 (diff) | |
download | edk2-ae658d9163afd6053db7d37d46f54388e33a0052.tar.gz edk2-ae658d9163afd6053db7d37d46f54388e33a0052.tar.bz2 edk2-ae658d9163afd6053db7d37d46f54388e33a0052.zip |
MdeModulePkg Variable: Move CacheVariable->InDeletedTransitionPtr NULL pointer check
This change is triggered by R18654 "Enhance variable performance by reading from existed memory cache"
that changed the code to use CacheVariable to improve performance.
So the CacheVariable->InDeletedTransitionPtr NULL pointer check needs to be moved to the place before
it is been used.
Cc: Shumin Qiu <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18688 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index e5ffb5a4e3..621ce16da0 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -2280,6 +2280,7 @@ UpdateVariable ( // Both ADDED and IN_DELETED_TRANSITION variable are present,
// set IN_DELETED_TRANSITION one to DELETED state first.
//
+ ASSERT (CacheVariable->InDeletedTransitionPtr != NULL);
State = CacheVariable->InDeletedTransitionPtr->State;
State &= VAR_DELETED;
Status = UpdateVariableStore (
@@ -2293,7 +2294,6 @@ UpdateVariable ( );
if (!EFI_ERROR (Status)) {
if (!Variable->Volatile) {
- ASSERT (CacheVariable->InDeletedTransitionPtr != NULL);
CacheVariable->InDeletedTransitionPtr->State = State;
}
} else {
@@ -2719,6 +2719,7 @@ UpdateVariable ( // Both ADDED and IN_DELETED_TRANSITION old variable are present,
// set IN_DELETED_TRANSITION one to DELETED state first.
//
+ ASSERT (CacheVariable->InDeletedTransitionPtr != NULL);
State = CacheVariable->InDeletedTransitionPtr->State;
State &= VAR_DELETED;
Status = UpdateVariableStore (
@@ -2732,7 +2733,6 @@ UpdateVariable ( );
if (!EFI_ERROR (Status)) {
if (!Variable->Volatile) {
- ASSERT (CacheVariable->InDeletedTransitionPtr != NULL);
CacheVariable->InDeletedTransitionPtr->State = State;
}
} else {
|