diff --git a/kernel/futex/core.c b/kernel/futex/core.c index 3bf6cb79f71a..0864c6e8cde7 100644 --- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -516,7 +516,7 @@ int get_futex_key(u32 __user *uaddr, unsigned int flags, union futex_key *key, * The futex address must be "naturally" aligned. */ key->both.offset = address % PAGE_SIZE; - if (unlikely((address % size) != 0)) + if (unlikely((address & (size-1)) != 0)) return -EINVAL; address -= key->both.offset;