Commit a552f204 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Hans de Goede

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: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20201204015746.1168941-1-srinivas.pandruvada@linux.intel.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 8b105ef6
...@@ -42,6 +42,9 @@ static long isst_if_mmio_rd_wr(u8 *cmd_ptr, int *write_only, int resume) ...@@ -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) if (io_reg->reg < 0x04 || io_reg->reg > 0xD0)
return -EINVAL; return -EINVAL;
if (io_reg->reg % 4)
return -EINVAL;
if (io_reg->read_write && !capable(CAP_SYS_ADMIN)) if (io_reg->read_write && !capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
......
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