mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-04 19:58:12 +02:00
Fix a few misc issues noticed by Coverity
This commit is contained in:
parent
6a1208b526
commit
8a2267ab6b
3 changed files with 7 additions and 6 deletions
|
|
@ -607,10 +607,11 @@ vlan_priorities_to_string (NMSettingVlan *s_vlan, NMVlanPriorityMap map)
|
|||
for (i = 0; i < nm_setting_vlan_get_num_priorities (s_vlan, map); i++) {
|
||||
guint32 from, to;
|
||||
|
||||
nm_setting_vlan_get_priority (s_vlan, map, i, &from, &to);
|
||||
g_string_append_printf (priorities, "%d:%d,", from, to);
|
||||
if (nm_setting_vlan_get_priority (s_vlan, map, i, &from, &to))
|
||||
g_string_append_printf (priorities, "%d:%d,", from, to);
|
||||
}
|
||||
g_string_truncate (priorities, priorities->len-1); /* chop off trailing ',' */
|
||||
if (priorities->len)
|
||||
g_string_truncate (priorities, priorities->len-1); /* chop off trailing ',' */
|
||||
|
||||
return g_string_free (priorities, FALSE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (priv->flags & !(NM_VLAN_FLAG_REORDER_HEADERS |
|
||||
if (priv->flags & ~(NM_VLAN_FLAG_REORDER_HEADERS |
|
||||
NM_VLAN_FLAG_GVRP |
|
||||
NM_VLAN_FLAG_LOOSE_BINDING)) {
|
||||
g_set_error (error,
|
||||
|
|
|
|||
|
|
@ -643,17 +643,17 @@ nm_device_vlan_new (const char *udi, const char *iface, NMDevice *parent)
|
|||
g_object_unref (device);
|
||||
return NULL;
|
||||
}
|
||||
priv->vlan_id = vlan_id;
|
||||
|
||||
if ( parent_ifindex < 0
|
||||
|| parent_ifindex != nm_device_get_ip_ifindex (parent)
|
||||
|| priv->vlan_id < 0) {
|
||||
|| vlan_id < 0) {
|
||||
nm_log_warn (LOGD_DEVICE, "(%s): VLAN parent ifindex (%d) or VLAN ID (%d) invalid.",
|
||||
iface, parent_ifindex, priv->vlan_id);
|
||||
g_object_unref (device);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
priv->vlan_id = vlan_id;
|
||||
priv->parent = g_object_ref (parent);
|
||||
priv->parent_state_id = g_signal_connect (priv->parent,
|
||||
"state-changed",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue