diff options
| author | Christophe Leroy <christophe.leroy@c-s.fr> | 2020-04-02 07:11:51 +0300 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2024-03-15 17:48:18 +0300 |
| commit | af289249ec5c79200c4ec4ec7f4902378956c4d7 (patch) | |
| tree | d794f452c898256f32064da223a02c132e108df7 /include/linux/debugobjects.h | |
| parent | 71317d703c550c819b5465c3a49ce98650089865 (diff) | |
| download | linux-af289249ec5c79200c4ec4ec7f4902378956c4d7.tar.xz | |
selftests/vm: fix map_hugetlb length used for testing read and write
[ Upstream commit cabc30da10e677c67ab9a136b1478175734715c5 ]
Commit fa7b9a805c79 ("tools/selftest/vm: allow choosing mem size and page
size in map_hugetlb") added the possibility to change the size of memory
mapped for the test, but left the read and write test using the default
value. This is unnoticed when mapping a length greater than the default
one, but segfaults otherwise.
Fix read_bytes() and write_bytes() by giving them the real length.
Also fix the call to munmap().
Fixes: fa7b9a805c79 ("tools/selftest/vm: allow choosing mem size and page size in map_hugetlb")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Leonardo Bras <leonardo@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r/9a404a13c871c4bd0ba9ede68f69a1225180dd7e.1580978385.git.christophe.leroy@c-s.fr
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
