Re: [PATCH 1/2] drm/radeon: Using unsigned long instead of unsigned to fix possible overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 4, 2022 at 6:05 AM Hanjun Guo <guohanjun@xxxxxxxxxx> wrote:
>
> 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.

ULONG in atombios is 32 bits so an int should be fine.

Alex

>
> Signed-off-by: Hanjun Guo <guohanjun@xxxxxxxxxx>
> ---
>  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
>



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux