Commit 21ce931e authored by Ian Rogers's avatar Ian Rogers Committed by Namhyung Kim

perf symbol: Avoid an undefined behavior warning

The node (nd) may be NULL and pointer arithmetic on NULL is undefined
behavior. Move the computation of next below the NULL check on the
node.
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Cc: James Clark <james.clark@arm.com>
Link: https://lore.kernel.org/r/20230914044233.1550195-1-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent 999b81b9
......@@ -202,11 +202,10 @@ void symbols__fixup_duplicate(struct rb_root_cached *symbols)
curr = rb_entry(nd, struct symbol, rb_node);
again:
nd = rb_next(&curr->rb_node);
next = rb_entry(nd, struct symbol, rb_node);
if (!nd)
break;
next = rb_entry(nd, struct symbol, rb_node);
if (curr->start != next->start)
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment