Skip to content

Commit

Permalink
platform/x86: ISST: Check for unaligned mmio address
Browse files Browse the repository at this point in the history
The address should be aligned to 4 byte boundary. So send an error for
unaligned address.

Signed-off-by: Srinivas Pandruvada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
  • Loading branch information
spandruvada authored and jwrdegoede committed Dec 7, 2020
1 parent 8b105ef commit a552f20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a552f20

Please sign in to comment.