summaryrefslogtreecommitdiffstats
path: root/lib/kunit/test.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-10-14 11:37:25 +0200
committerShuah Khan <skhan@linuxfoundation.org>2022-10-18 23:08:42 +0200
commit618887768bb71f0a475334fa5a4fba7dc98d7ab5 (patch)
treefcf7314223150ba06640e17526e1321cab3f7525 /lib/kunit/test.c
parentLinux 6.1-rc1 (diff)
downloadlinux-618887768bb71f0a475334fa5a4fba7dc98d7ab5.tar.xz
linux-618887768bb71f0a475334fa5a4fba7dc98d7ab5.zip
kunit: update NULL vs IS_ERR() tests
The alloc_string_stream() functions were changed from returning NULL on error to returning error pointers so these caller needs to be updated as well. Fixes: 78b1c6584fce ("kunit: string-stream: Simplify resource use") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Daniel Latypov <dlatypov@google.com> Reviewed-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'lib/kunit/test.c')
-rw-r--r--lib/kunit/test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kunit/test.c b/lib/kunit/test.c
index 90640a43cf62..2a6992fe7c3e 100644
--- a/lib/kunit/test.c
+++ b/lib/kunit/test.c
@@ -265,7 +265,7 @@ static void kunit_fail(struct kunit *test, const struct kunit_loc *loc,
kunit_set_failure(test);
stream = alloc_string_stream(test, GFP_KERNEL);
- if (!stream) {
+ if (IS_ERR(stream)) {
WARN(true,
"Could not allocate stream to print failed assertion in %s:%d\n",
loc->file,