mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 06:43:35 +08:00
Uavcan:Fix null pointer defrefenence
This commit is contained in:
committed by
Lorenz Meier
parent
993755b24b
commit
64cf310c8a
@@ -936,12 +936,15 @@ UavcanNode::print_info()
|
|||||||
printf("CAN%u status:\n", unsigned(i + 1));
|
printf("CAN%u status:\n", unsigned(i + 1));
|
||||||
|
|
||||||
auto iface = _node.getDispatcher().getCanIOManager().getCanDriver().getIface(i);
|
auto iface = _node.getDispatcher().getCanIOManager().getCanDriver().getIface(i);
|
||||||
printf("\tHW errors: %llu\n", iface->getErrorCount());
|
|
||||||
|
|
||||||
auto iface_perf_cnt = _node.getDispatcher().getCanIOManager().getIfacePerfCounters(i);
|
if (iface) {
|
||||||
printf("\tIO errors: %llu\n", iface_perf_cnt.errors);
|
printf("\tHW errors: %llu\n", iface->getErrorCount());
|
||||||
printf("\tRX frames: %llu\n", iface_perf_cnt.frames_rx);
|
|
||||||
printf("\tTX frames: %llu\n", iface_perf_cnt.frames_tx);
|
auto iface_perf_cnt = _node.getDispatcher().getCanIOManager().getIfacePerfCounters(i);
|
||||||
|
printf("\tIO errors: %llu\n", iface_perf_cnt.errors);
|
||||||
|
printf("\tRX frames: %llu\n", iface_perf_cnt.frames_rx);
|
||||||
|
printf("\tTX frames: %llu\n", iface_perf_cnt.frames_tx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user