diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2020-12-03 17:57:44 -0800 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2020-12-07 16:10:12 +0100 |
commit | a552f204b050b213b1e41a5134a0d2726c9a2ec1 (patch) | |
tree | 0f61b733d2f3025a31fb605463f6beb7562d1296 | |
parent | 8b105ef6ffb78d208b93e4c4b47e83dbd438cc12 (diff) |
platform/x86: ISST: Check for unaligned mmio address
The address should be aligned to 4 byte boundary. So send an error for
unaligned address.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20201204015746.1168941-1-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c b/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c index aa17fd7817f8..e7e9808a1aed 100644 --- a/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c +++ b/drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c @@ -42,6 +42,9 @@ static long isst_if_mmio_rd_wr(u8 *cmd_ptr, int *write_only, int resume) if (io_reg->reg < 0x04 || io_reg->reg > 0xD0) return -EINVAL; + if (io_reg->reg % 4) + return -EINVAL; + if (io_reg->read_write && !capable(CAP_SYS_ADMIN)) return -EPERM; |