]> xenbits.xensource.com Git - ovmf.git/commitdiff
UefiCpuPkg/PiSmmCpuDxeSmm: fix format string
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 27 Mar 2023 08:02:07 +0000 (16:02 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sat, 1 Apr 2023 03:15:51 +0000 (03:15 +0000)
BufferPages is UINTN, so we need "%Lu" when printing it to avoid
it being truncated.  Also cast to UINT64 to make sure it works
for 32bit builds too.

Fixes: 4f441d024bee ("UefiCpuPkg/PiSmmCpuDxeSmm: fix error handling")
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c

index cf69161caa4bf87376d1269154a1c1540f7e9d11..c0e368ea94756d507dac5b164d952bfb6794e88c 100644 (file)
@@ -880,7 +880,7 @@ PiCpuSmmEntry (
     BufferPages = EFI_SIZE_TO_PAGES (SIZE_32KB + TileSize * (mMaxNumberOfCpus - 1));\r
     Buffer      = AllocateAlignedCodePages (BufferPages, SIZE_4KB);\r
     if (Buffer == NULL) {\r
-      DEBUG ((DEBUG_ERROR, "Failed to allocate %d pages.\n", BufferPages));\r
+      DEBUG ((DEBUG_ERROR, "Failed to allocate %Lu pages.\n", (UINT64)BufferPages));\r
       CpuDeadLoop ();\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r