kernel-hacking-2024-linux-s.../lib/kunit
Rae Moar dd2f0a0a2f kunit: fix bug in KUNIT_EXPECT_MEMEQ
In KUNIT_EXPECT_MEMEQ and KUNIT_EXPECT_MEMNEQ, add check if one of the
inputs is NULL and fail if this is the case.

Currently, the kernel crashes if one of the inputs is NULL. Instead,
fail the test and add an appropriate error message.

Fixes: b8a926bea8 ("kunit: Introduce KUNIT_EXPECT_MEMEQ and KUNIT_EXPECT_MEMNEQ macros")

This was found by the kernel test robot:
https://lore.kernel.org/all/202212191448.D6EDPdOh-lkp@intel.com/

Reported-by: kernel test robot <lkp@intel.com>

Signed-off-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-01-30 14:46:46 -07:00
..
.kunitconfig
assert.c kunit: fix bug in KUNIT_EXPECT_MEMEQ 2023-01-30 14:46:46 -07:00
debugfs.c kunit: improve KTAP compliance of KUnit test output 2022-12-12 14:13:47 -07:00
debugfs.h
executor.c kunit: improve KTAP compliance of KUnit test output 2022-12-12 14:13:47 -07:00
executor_test.c
Kconfig
kunit-example-test.c kunit: Add KUnit memory block assertions to the example_all_expect_macros_test 2022-10-27 02:39:59 -06:00
kunit-test.c kunit: make kunit_kfree() only work on pointers from kunit_malloc() and friends 2022-10-07 10:15:44 -06:00
Makefile
resource.c
string-stream-test.c
string-stream.c kunit: alloc_string_stream_fragment error handling bug fix 2022-12-26 16:01:36 -07:00
string-stream.h kunit: drop test pointer in string_stream_fragment 2022-10-07 10:15:33 -06:00
test.c kunit: Export kunit_running() 2023-01-20 10:03:04 -07:00
try-catch-impl.h
try-catch.c