From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx/ Reported-by: Ian Rogers <irogers@xxxxxxxxxx> Fixes: aff006d4af0c7 ("libtracefs: Do not initialize with NULL offsets") Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> --- src/tracefs-dynevents.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tracefs-dynevents.c b/src/tracefs-dynevents.c index 48bb26a96c58..7a3c45ce25a3 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]) { -- 2.35.1