summaryrefslogtreecommitdiff
path: root/lib/kunit/string-stream.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-10-14 12:37:25 +0300
committerShuah Khan <skhan@linuxfoundation.org>2022-10-18 15:08:42 -0600
commit618887768bb71f0a475334fa5a4fba7dc98d7ab5 (patch)
treefcf7314223150ba06640e17526e1321cab3f7525 /lib/kunit/string-stream.c
parent9abf2313adc1ca1b6180c508c25f22f9395cc780 (diff)
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/string-stream.c')
-rw-r--r--lib/kunit/string-stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/kunit/string-stream.c b/lib/kunit/string-stream.c
index f5ae79c37400..a608746020a9 100644
--- a/lib/kunit/string-stream.c
+++ b/lib/kunit/string-stream.c
@@ -56,8 +56,8 @@ int string_stream_vadd(struct string_stream *stream,
frag_container = alloc_string_stream_fragment(stream->test,
len,
stream->gfp);
- if (!frag_container)
- return -ENOMEM;
+ if (IS_ERR(frag_container))
+ return PTR_ERR(frag_container);
len = vsnprintf(frag_container->fragment, len, fmt, args);
spin_lock(&stream->lock);