platform: avoid coverity warning about not checking nla_nest_start() result

Usually we check the result of nla_nest_start(). Also, in most cases where this
function would return %NULL, it's an actual bug. That is, because our netlink
message is allocated with a large buffer, and in most cases we append there a well
known, small amount of data.

To make coverity happy, handle the case and assert.

(cherry picked from commit 243458836a)
This commit is contained in:
Thomas Haller 2019-08-01 17:48:48 +02:00
parent 18f7a36ba1
commit 3c6252f4fd

View file

@ -347,6 +347,8 @@ wifi_nl80211_set_wake_on_wlan (NMWifiUtils *data, NMSettingWirelessWakeOnWLan wo
return FALSE;
triggers = nla_nest_start (msg, NL80211_ATTR_WOWLAN_TRIGGERS);
if (!triggers)
goto nla_put_failure;
if (NM_FLAGS_HAS (wowl, NM_SETTING_WIRELESS_WAKE_ON_WLAN_ANY))
NLA_PUT_FLAG (msg, NL80211_WOWLAN_TRIG_ANY);