i2ctrace: add safety check
Prevent NULL dereference coming from get_i2c_port
BRANCH=none
TEST=none
Code-Coverage: Zoss
@@ -67,7 +67,7 @@ static int command_i2ctrace_list(void)
i2c_port = get_i2c_port(trace_entries[i].port);
ccprintf("%-2zd %d %-8s 0x%X", i, trace_entries[i].port,
#ifndef CONFIG_ZEPHYR
- i2c_port->name,
+ i2c_port ? i2c_port->name : "invalid",
#else
"",
#endif /* CONFIG_ZEPHYR */
