From: Ian Rogers <irogers@google.com>
To: linux-trace-devel@vger.kernel.org,
Tzvetomir Stoyanov <tz.stoyanov@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>
Cc: Ian Rogers <irogers@google.com>
Subject: [PATCH 2/3] libtracefs: Avoid null access
Date: Thu, 24 Feb 2022 15:48:22 -0800 [thread overview]
Message-ID: <20220224234823.1190425-2-irogers@google.com> (raw)
In-Reply-To: <20220224234823.1190425-1-irogers@google.com>
The for loop handles devents == NULL, but the test afterwards needs to
also.
Signed-off-by: Ian Rogers <irogers@google.com>
---
utest/tracefs-utest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c
index 5163004..7042fa9 100644
--- a/utest/tracefs-utest.c
+++ b/utest/tracefs-utest.c
@@ -433,7 +433,7 @@ static void test_synth_compare(struct test_synth *synth, struct tracefs_dynevent
free(event);
free(format);
}
- CU_TEST(devents[i] == NULL);
+ CU_TEST(devents == NULL || devents[i] == NULL);
}
static void test_instance_synthetic(struct tracefs_instance *instance)
--
2.35.1.574.g5d30c73bfb-goog
next prev parent reply other threads:[~2022-02-24 23:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 23:48 [PATCH 1/3] libtracefs: Fix spelling in test name Ian Rogers
2022-02-24 23:48 ` Ian Rogers [this message]
2022-02-24 23:48 ` [PATCH 3/3] libtracefs: Move initialization below a null test Ian Rogers
2022-02-24 23:55 ` Steven Rostedt
2022-02-25 0:09 ` Ian Rogers
2022-02-25 0:20 ` Steven Rostedt
2022-02-25 0:21 ` Ian Rogers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220224234823.1190425-2-irogers@google.com \
--to=irogers@google.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tz.stoyanov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.