Message ID | 20230530002313.4094ef33@rorschach.local.home (mailing list archive) |
---|---|
State | Accepted |
Commit | e97c311389c4b91e2044cddd0c33417b969329d7 |
Headers | show |
Series | libtracefs: Do not segfault in tests if synthetic events are not configured | expand |
diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c index 17fcac722fbc..9cfafdbd039c 100644 --- a/utest/tracefs-utest.c +++ b/utest/tracefs-utest.c @@ -994,7 +994,9 @@ static void test_synth_compare(struct test_synth *synth, struct tracefs_dynevent stype = tracefs_dynevent_info(devents[i], NULL, &event, NULL, NULL, &format); CU_TEST(stype == TRACEFS_DYNEVENT_SYNTH); - CU_TEST(strcmp(event, synth[i].name) == 0); + if (stype != TRACEFS_DYNEVENT_SYNTH) + continue; + CU_TEST(event && synth[i].name && strcmp(event, synth[i].name) == 0); if (synth[i].match_name) { CU_TEST(strstr(format, synth[i].match_name) != NULL); }