kunit: print a message before triggering a NULL dereference
Subsystems (3)
PATCH 1/1 kunit: print a message before triggering a NULL dereference
Print a message so that people reading dmesg know that these NULL dereferences are not a bug, but instead a deliberate part of the testing.
Signed-off-by Dan Carpenter <[email protected]>
--- lib/kunit/kunit-test.c | 2 ++ 1 file changed, 2 insertions(+)
lib/kunit/kunit-test.c +2 -0
@@ -119,6 +119,8 @@ static void kunit_test_null_dereference(void *data)struct kunit *test = data;int *null =NULL ; +pr_info ("Triggering deliberate NULL derefence.\n" ); + *null =0 ;KUNIT_FAIL (test,"This line should never be reached\n" );
Signature · 1 line
2.47.2