diff options
author | Guomin Jiang <guomin.jiang@intel.com> | 2020-03-26 14:35:54 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-03-27 01:04:25 +0000 |
commit | 695d90b9b156573d0dafb20afecea09dc9a914f4 (patch) | |
tree | 03927ed93057e8e1e5be2d0639109cf7f5954324 /MdeModulePkg | |
parent | a1c35ff312efb1452427e695d58fb1f26b67661e (diff) | |
download | edk2-695d90b9b156573d0dafb20afecea09dc9a914f4.tar.gz edk2-695d90b9b156573d0dafb20afecea09dc9a914f4.tar.bz2 edk2-695d90b9b156573d0dafb20afecea09dc9a914f4.zip |
MdeModulePkg/SdDxe: Check the Token to avoid null pointer
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2286
Token pointer may be NULL, it should be checked before use it.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c index 9f42abe7e2..721f264377 100644 --- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c @@ -1367,7 +1367,14 @@ SdEraseBlocks ( return Status;
}
- DEBUG ((EFI_D_ERROR, "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p with %r\n", Lba, BlockNum, Token->Event, Status));
+ DEBUG ((
+ DEBUG_INFO,
+ "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p with %r\n",
+ Lba,
+ BlockNum,
+ (Token != NULL) ? Token->Event : NULL,
+ Status
+ ));
return Status;
}
|