From bb307cd462789f047bba4d29984cf635292da466 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Fri, 22 Jan 2021 16:23:54 +0200 Subject: [PATCH] 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 --- platforms/common/uORB/uORBDeviceNode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/common/uORB/uORBDeviceNode.cpp b/platforms/common/uORB/uORBDeviceNode.cpp index 387feae1c7..f691665529 100644 --- a/platforms/common/uORB/uORBDeviceNode.cpp +++ b/platforms/common/uORB/uORBDeviceNode.cpp @@ -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; }