From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.29584.1679904133671895213 for ; Mon, 27 Mar 2023 01:02:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aiJoUtuQ; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679904132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZxkDElaytq5fB4SS3ChD8lR03+CHk13RfCFg2eK8wg8=; b=aiJoUtuQ8wgPlyTXhYKWykPVnd6p/OLIvl1cVVmuT4Jxujku2+Hk8WaKsijyfTaV7GRGbd JOIf+vbReV3r2Q6xfzm9ys9hvgcTCNXXVylS6/LV3iBBf4C6JkN+3J+49GlEwVTDXCWPhZ WNRBCdKA6I1V0/Dh5mPfzbOzARZxnrw= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-169-bdZ0giG_NReJh21vLFor8w-1; Mon, 27 Mar 2023 04:02:10 -0400 X-MC-Unique: bdZ0giG_NReJh21vLFor8w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5ABA03814944; Mon, 27 Mar 2023 08:02:10 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0121044037; Mon, 27 Mar 2023 08:02:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 43D251801B04; Mon, 27 Mar 2023 10:02:07 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Eric Dong , Rahul Kumar , Oliver Steffen , Pawel Polawski , Ray Ni , Laszlo Ersek Subject: [PATCH v2 1/1] UefiCpuPkg/PiSmmCpuDxeSmm: fix format string Date: Mon, 27 Mar 2023 10:02:07 +0200 Message-Id: <20230327080207.33524-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Signed-off-by: Gerd Hoffmann --- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c index cf69161caa4b..c0e368ea9475 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c @@ -880,7 +880,7 @@ PiCpuSmmEntry ( BufferPages = EFI_SIZE_TO_PAGES (SIZE_32KB + TileSize * (mMaxNumberOfCpus - 1)); Buffer = AllocateAlignedCodePages (BufferPages, SIZE_4KB); if (Buffer == NULL) { - DEBUG ((DEBUG_ERROR, "Failed to allocate %d pages.\n", BufferPages)); + DEBUG ((DEBUG_ERROR, "Failed to allocate %Lu pages.\n", (UINT64)BufferPages)); CpuDeadLoop (); return EFI_OUT_OF_RESOURCES; } -- 2.39.2