summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/exported-sql-viewer.py
diff options
context:
space:
mode:
authorlonglong yan <yanlonglong@kylinos.cn>2026-07-21 14:36:11 +0800
committerAndrew Morton <akpm@linux-foundation.org>2026-08-06 18:57:21 -0700
commit9922d4ced6c0f80427c8d49738581c34bd2d64da (patch)
treeef59b5cc69151954eab149baf30fdbfaef309dd1 /tools/perf/scripts/python/exported-sql-viewer.py
parent63b420948250550d2fe7bf50c4ccf95cb4afa9fd (diff)
selftests/mm/pagemap_ioctl: fix missing NULL checks after calloc()
The pagemap_ioctl selftest allocates memory via calloc() in several places but does not check the return values. If calloc() fails, the subsequent code will dereference a NULL pointer and crash. Additionally, in sanity_tests(), the calloc() failure check incorrectly uses MAP_FAILED (the mmap() error constant) instead of NULL. Since calloc() returns NULL on failure, the check never triggers and a failed allocation goes undetected. Add NULL checks after each calloc() call, and fix the wrong error constant in sanity_tests(). Use ksft_exit_fail_msg() consistent with the existing error handling pattern in the file. Link: https://lore.kernel.org/20260721063611.342-1-yanlonglong@kylinos.cn Signed-off-by: longlong yan <yanlonglong@kylinos.cn> Acked-by: David Hildenbrand (Arm) <david@kernel.org> Reviewed-by: SJ Park <sj@kernel.org> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions