Skip to content

Commit 0686507

Browse files
Stefan Bindingrafaeljw
authored andcommitted
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: 9230441 ("ACPI: property: Unify integer value reading functions") Signed-off-by: Stefan Binding <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Tested-by: Sakari Ailus <[email protected]> Tested-by: John Garry <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 1c23f9e commit 0686507

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/acpi/property.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,10 +1043,10 @@ static int acpi_data_prop_read_single(const struct acpi_device_data *data,
10431043
break; \
10441044
} \
10451045
if (__items[i].integer.value > _Generic(__val, \
1046-
u8: U8_MAX, \
1047-
u16: U16_MAX, \
1048-
u32: U32_MAX, \
1049-
u64: U64_MAX, \
1046+
u8 *: U8_MAX, \
1047+
u16 *: U16_MAX, \
1048+
u32 *: U32_MAX, \
1049+
u64 *: U64_MAX, \
10501050
default: 0U)) { \
10511051
ret = -EOVERFLOW; \
10521052
break; \

0 commit comments

Comments
 (0)