Browse Source

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>
master
Jukka Laitinen 4 years ago committed by Beat Küng
parent
commit
bb307cd462
  1. 2
      platforms/common/uORB/uORBDeviceNode.cpp

2
platforms/common/uORB/uORBDeviceNode.cpp

@ -323,7 +323,7 @@ uORB::DeviceNode::publish(const orb_metadata *meta, orb_advert_t handle, const v @@ -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 */
if (devnode->_meta != meta) {
if (devnode->_meta->o_id != meta->o_id) {
errno = EINVAL;
return PX4_ERROR;
}

Loading…
Cancel
Save