diff options
author | 2023-10-30 10:47:46 +0000 | |
---|---|---|
committer | 2023-12-18 13:21:14 -0700 | |
commit | 15bf0000147ae9fc8fa4969025f71848fc558cba (patch) | |
tree | 32cf92d581b01c348be1c75860751f7834779f71 /tools/perf/scripts/python/stackcollapse.py | |
parent | kunit: string-stream-test: Avoid cast warning when testing gfp_t flags (diff) | |
download | wireguard-linux-15bf0000147ae9fc8fa4969025f71848fc558cba.tar.xz wireguard-linux-15bf0000147ae9fc8fa4969025f71848fc558cba.zip |
kunit: string-stream: Allow ERR_PTR to be passed to string_stream_destroy()
Check the stream pointer passed to string_stream_destroy() for
IS_ERR_OR_NULL() instead of only NULL.
Whatever alloc_string_stream() returns should be safe to pass
to string_stream_destroy(), and that will be an ERR_PTR.
It's obviously good practise and generally helpful to also check
for NULL pointers so that client cleanup code can call
string_stream_destroy() unconditionally - which could include
pointers that have never been set to anything and so are NULL.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions