MdeModulePkg MemoryProfile: Add ASSERTs to make sure pointers are not NULL

Code logic ensures that both pointers 'DriverInfoData' and 'AllocInfoData'
will not be NULL when they are used.

Add ASSERTs as warning for cases that will not happen.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Hao Wu 2016-07-04 12:38:28 +08:00
parent 6f9760d88b
commit 9cda0af7ec
2 changed files with 6 additions and 0 deletions

View File

@ -1283,6 +1283,9 @@ CoreUpdateProfileFree (
}
}
ASSERT (DriverInfoData != NULL);
ASSERT (AllocInfoData != NULL);
Found = TRUE;
Context = &ContextData->Context;

View File

@ -1403,6 +1403,9 @@ SmmCoreUpdateProfileFree (
}
}
ASSERT (DriverInfoData != NULL);
ASSERT (AllocInfoData != NULL);
Found = TRUE;
Context = &ContextData->Context;