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:
Jukka Laitinen 2021-01-22 16:23:54 +02:00 committed by Beat Küng
parent 0b9505453d
commit bb307cd462
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}