Commit 53fc7e80 authored by Shuai Xue's avatar Shuai Xue Committed by Rafael J. Wysocki

ACPI: APEI: EINJ: Limit error type to 32-bit width

The bit map of error types to inject is 32-bit width [1].

Add parameter check to reflect the fact.

[1] ACPI Specification 6.4, Section 18.6.4. Error Types
Signed-off-by: default avatarShuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: default avatarTony Luck <tony.luck@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 6d796c50
......@@ -616,6 +616,10 @@ static int error_type_set(void *data, u64 val)
u32 available_error_type = 0;
u32 tval, vendor;
/* Only low 32 bits for error type are valid */
if (val & GENMASK_ULL(63, 32))
return -EINVAL;
/*
* Vendor defined types have 0x80000000 bit set, and
* are not enumerated by ACPI_EINJ_GET_ERROR_TYPE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment