mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 07:00:13 +01:00
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:
parent
18f7a36ba1
commit
3c6252f4fd
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue