diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-12-15 15:55:34 -0500 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-12-15 18:51:08 -0500 |
commit | a053233c583fe3e7c53e99a233c3bfac0a828a3b (patch) | |
tree | 6ea045cd42fb1952270b827ed9250f7a8214a416 | |
parent | b71d3e3654e242ec4d98d1df7e5169943939c615 (diff) | |
download | libtracefs-a053233c583fe3e7c53e99a233c3bfac0a828a3b.tar.gz |
libtracefs: Remove unneeded check of !dynevent in dynevent_info()
The compiler was complaining about undefined behavior because
dynevent_info() was accessing the address of &dynevent->system and later
doing a if (!dynevent). But this was fixed by creating a wrapper function
that does the checks and then passes the information to this function.
But that commit forgot to remove the check of !dynevent leaving the
compiler to believe that it can still be NULL and that the undefined
behavior of &dynevent->system still exists.
Remove the if statement and make everyone happy.
Link: https://lore.kernel.org/linux-trace-devel/20221215140203.103faf50@gandalf.local.home/
Link: https://lore.kernel.org/linux-trace-devel/20221215155534.1616b67a@gandalf.local.home
Reported-by: Ian Rogers <irogers@google.com>
Fixes: aff006d4af0c7 ("libtracefs: Do not initialize with NULL offsets")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r-- | src/tracefs-dynevents.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/tracefs-dynevents.c b/src/tracefs-dynevents.c index 48bb26a..7a3c45c 100644 --- a/src/tracefs-dynevents.c +++ b/src/tracefs-dynevents.c @@ -713,9 +713,6 @@ dynevent_info(struct tracefs_dynevent *dynevent, char **system, &dynevent->address, &dynevent->format }; int i; - if (!dynevent) - return TRACEFS_DYNEVENT_UNKNOWN; - for (i = 0; i < ARRAY_SIZE(lv); i++) { if (lv[i]) { if (*rv[i]) { |