From: Hanjun Guo <guohanjun@huawei.com>
To: <amd-gfx@lists.freedesktop.org>, <dri-devel@lists.freedesktop.org>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Hanjun Guo <guohanjun@huawei.com>
Subject: [PATCH 1/2] drm/radeon: Using unsigned long instead of unsigned to fix possible overflow
Date: Fri, 4 Nov 2022 17:50:01 +0800 [thread overview]
Message-ID: <1667555402-52866-1-git-send-email-guohanjun@huawei.com> (raw)
VBIOSImageOffset in struct UEFI_ACPI_VFCT is ULONG (unsigned long),
but it will be assigned to "unsigned offset", so use unsigned long
instead of unsigned for the offset, to avoid possible overflow.
Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
drivers/gpu/drm/radeon/radeon_bios.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
index 3312165..520d1d6 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -611,7 +611,7 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
struct acpi_table_header *hdr;
acpi_size tbl_size;
UEFI_ACPI_VFCT *vfct;
- unsigned offset;
+ unsigned long offset;
if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr)))
return false;
--
1.7.12.4
next reply other threads:[~2022-11-04 10:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 9:50 Hanjun Guo [this message]
2022-11-04 9:50 ` [PATCH 2/2] drm/radeon: Add the missed acpi_put_table() to fix memory leak Hanjun Guo
2022-11-08 15:36 ` Alex Deucher
2022-11-04 18:31 ` [PATCH 1/2] drm/radeon: Using unsigned long instead of unsigned to fix possible overflow Alex Deucher
2022-11-07 1:41 ` Hanjun Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1667555402-52866-1-git-send-email-guohanjun@huawei.com \
--to=guohanjun@huawei.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).