Skip to content

Commit

Permalink
kasan: test: Use NULL macros
Browse files Browse the repository at this point in the history
Replace PTR_EQ checks with the more idiomatic and specific NULL macros.

Acked-by: Daniel Latypov <[email protected]>
Signed-off-by: Ricardo Ribalda <[email protected]>
Acked-by: Brendan Higgins <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
  • Loading branch information
ribalda authored and shuahkh committed Apr 4, 2022
1 parent 7aadf84 commit ccad78f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/test_kasan.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ static void krealloc_uaf(struct kunit *test)
kfree(ptr1);

KUNIT_EXPECT_KASAN_FAIL(test, ptr2 = krealloc(ptr1, size2, GFP_KERNEL));
KUNIT_ASSERT_PTR_EQ(test, (void *)ptr2, NULL);
KUNIT_ASSERT_NULL(test, ptr2);
KUNIT_EXPECT_KASAN_FAIL(test, *(volatile char *)ptr1);
}

Expand Down

0 comments on commit ccad78f

Please sign in to comment.