mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 07:13:34 +08:00
Fix comparing orb_metadata in uORB::DeviceNode::publish
Don't compare pointers to metadata, but the metadata contents. In protected/kernel build there are two sets of metadata, on on kernel side and another in user side. Thus the comparison of pointers would just always fail. Compare orb_id instead Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
committed by
Beat Küng
parent
0b9505453d
commit
bb307cd462
@@ -323,7 +323,7 @@ uORB::DeviceNode::publish(const orb_metadata *meta, orb_advert_t handle, const v
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* check if the orb meta data matches the publication */
|
/* check if the orb meta data matches the publication */
|
||||||
if (devnode->_meta != meta) {
|
if (devnode->_meta->o_id != meta->o_id) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return PX4_ERROR;
|
return PX4_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user