mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
ACPI: property: Fix type detection of unified integer reading functions
The current code expects the type of the value to be an integer type,
instead the value passed to the macro is a pointer.
Ensure the size comparison uses the correct pointer type to choose the
max value, instead of using the integer type.
Fixes: 9230441333
("ACPI: property: Unify integer value reading functions")
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: John Garry <john.garry@huawei.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
1c23f9e627
commit
06865077b3
@ -1043,10 +1043,10 @@ static int acpi_data_prop_read_single(const struct acpi_device_data *data,
|
||||
break; \
|
||||
} \
|
||||
if (__items[i].integer.value > _Generic(__val, \
|
||||
u8: U8_MAX, \
|
||||
u16: U16_MAX, \
|
||||
u32: U32_MAX, \
|
||||
u64: U64_MAX, \
|
||||
u8 *: U8_MAX, \
|
||||
u16 *: U16_MAX, \
|
||||
u32 *: U32_MAX, \
|
||||
u64 *: U64_MAX, \
|
||||
default: 0U)) { \
|
||||
ret = -EOVERFLOW; \
|
||||
break; \
|
||||
|
Loading…
Reference in New Issue
Block a user