platform: assert for success genlmsg_put() in _nl802154_alloc_msg()

This commit is contained in:
Thomas Haller
2022-07-25 15:46:21 +02:00
parent 9c3e0846ee
commit b3f60d891f

View File

@@ -80,7 +80,8 @@ _nl802154_alloc_msg(guint16 genl_family_id, int ifindex, uint8_t cmd, uint16_t f
nm_auto_nlmsg struct nl_msg *msg = NULL;
msg = nlmsg_alloc();
genlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, genl_family_id, 0, flags, cmd, 0);
if (!genlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, genl_family_id, 0, flags, cmd, 0))
goto nla_put_failure;
NLA_PUT_U32(msg, NL802154_ATTR_IFINDEX, ifindex);
return g_steal_pointer(&msg);