mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 08:50:34 +08:00
uORB: fix node_open: *instance is read even though it's an output parameter
This fixes a subtle bug: the instance parameter of orb_advertise is an output parameter and thus its value can be random. However in node_open this value is accessed and thus the open(...) call could succeed even though it should not. This can happen for example if a second advertiser of a topic calls orb_advertise_multi with *instance=0. The existing implementation worked only because *instance was initialized with -1 in most cases.
This commit is contained in:
@@ -124,7 +124,7 @@ int uORBTest::UnitTest::pubsublatency_main(void)
|
||||
|
||||
delete[] timings;
|
||||
|
||||
warnx("mean: %8.4f", static_cast<double>(latency_integral / maxruns));
|
||||
warnx("mean: %8.4f us", static_cast<double>(latency_integral / maxruns));
|
||||
|
||||
pubsubtest_passed = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user