diff options
author | PaddyDeng <v-paddydeng@microsoft.com> | 2025-04-07 09:48:50 +0800 |
---|---|---|
committer | Liming Gao <gaoliming@byosoft.com.cn> | 2025-05-05 14:26:16 +0800 |
commit | 2cff8743ced9c2f79014a19077e91537fb938bb8 (patch) | |
tree | 3a33c23edde7b89bf5f4fc306237ce380dce2798 /BaseTools/Source/Python/UPT/UPT.py | |
parent | 02ec228654b8e17d3966f29f99fde9cc22152d4d (diff) | |
download | edk2-2cff8743ced9c2f79014a19077e91537fb938bb8.tar.gz edk2-2cff8743ced9c2f79014a19077e91537fb938bb8.tar.bz2 edk2-2cff8743ced9c2f79014a19077e91537fb938bb8.zip |
The pointer `Instance->SfdpBasicFlash` can be used before initializing.
Example code flow:
- CreateSpiNorFlashSfdpInstance: Allocate pool for `Instance`
- InitialSpiNorFlashSfdpInstance
- ReadSfdp
- ReadSfdpHeader
- FillWriteBuffer: Dereferencing
`Instance->SfdpBasicFlash`
- ReadSfdpBasicParameterTable: Allocate pool for
`Instance->SfdpBasicFlash`
Check both `Instance` and `Instance->SfdpBasicFlash` should have
a non null value before dereferencing it. Otherwise use the defaut
value 0.
Also terminate the function if `Instance` or `WriteBuffer` is NULL.
Signed-off-by: Paddy Deng <v-paddydeng@microsoft.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT/UPT.py')
0 files changed, 0 insertions, 0 deletions