selftests: x86: fix [-Wstringop-overread] warn in test_process_vm_readv()
authorShuah Khan <skhan@linuxfoundation.org>
Thu, 21 Oct 2021 21:33:33 +0000 (15:33 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jan 2022 14:24:58 +0000 (15:24 +0100)
commitc1e2da4b3f72a0dc312f6b35ec3d3a39777f54e2
treec37ce05ce66a89c40964d7cf0fa29dcac4ee41da
parent384111e123675a39f461a0004e00e14f8c81918d
selftests: x86: fix [-Wstringop-overread] warn in test_process_vm_readv()

commit dd40f44eabe1e122c6852fabb298aac05b083fce upstream.

Fix the following [-Wstringop-overread] by passing in the variable
instead of the value.

test_vsyscall.c: In function ‘test_process_vm_readv’:
test_vsyscall.c:500:22: warning: ‘__builtin_memcmp_eq’ specified bound 4096 exceeds source size 0 [-Wstringop-overread]
  500 |                 if (!memcmp(buf, (const void *)0xffffffffff600000, 4096)) {
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/x86/test_vsyscall.c