diff options
author | Thomas Haller <thaller@redhat.com> | 2013-11-13 18:24:42 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2013-11-13 18:43:18 +0100 |
commit | 709bc90b6bf163d07245669451cc5d97e32bda7f (patch) | |
tree | 78780adeaf2b73e264b00dc7a3b7ce4c5aacb8e5 | |
parent | 97935382f4aca80b8f952ea9fe3ce205253758b7 (diff) | |
download | NetworkManager-709bc90b6bf163d07245669451cc5d97e32bda7f.tar.gz |
coverity: fix various warnings detected with Coverity (fixup)
I missed to implement the remarks from
https://bugzilla.redhat.com/show_bug.cgi?id=1025894#c4
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r-- | src/devices/nm-device-vlan.c | 7 | ||||
-rw-r--r-- | src/dhcp-manager/nm-dhcp-dhcpcd.c | 3 | ||||
-rw-r--r-- | src/nm-wifi-ap-utils.c | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c index 0cf2800b73..f64fd87eb7 100644 --- a/src/devices/nm-device-vlan.c +++ b/src/devices/nm-device-vlan.c @@ -318,7 +318,12 @@ update_connection (NMDevice *device, NMConnection *connection) g_object_set (s_vlan, NM_SETTING_VLAN_INTERFACE_NAME, nm_device_get_iface (device), NULL); } - (void) nm_platform_vlan_get_info (ifindex, &parent_ifindex, &vlan_id); + if (!nm_platform_vlan_get_info (ifindex, &parent_ifindex, &vlan_id)) { + nm_log_warn (LOGD_VLAN, "(%s): failed to get VLAN interface info while updating connection.", + nm_device_get_iface (device)); + return; + } + if (priv->vlan_id != vlan_id) { priv->vlan_id = vlan_id; g_object_notify (G_OBJECT (device), NM_DEVICE_VLAN_ID); diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 9a9ec8af6f..845f631ca1 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -173,9 +173,10 @@ stop (NMDHCPClient *client, gboolean release, const GByteArray *duid) /* Chain up to parent */ NM_DHCP_CLIENT_CLASS (nm_dhcp_dhcpcd_parent_class)->stop (client, release, duid); - if (priv->pid_file) + if (priv->pid_file) { if (remove (priv->pid_file) == -1) nm_log_dbg (LOGD_DHCP, "Could not remove dhcp pid file \"%s\": %d (%s)", priv->pid_file, errno, g_strerror (errno)); + } /* FIXME: implement release... */ } diff --git a/src/nm-wifi-ap-utils.c b/src/nm-wifi-ap-utils.c index 26886e86d0..9b03cbd45f 100644 --- a/src/nm-wifi-ap-utils.c +++ b/src/nm-wifi-ap-utils.c @@ -312,7 +312,7 @@ verify_wpa_psk (NMSettingWirelessSecurity *s_wsec, n = nm_setting_wireless_security_get_num_pairwise (s_wsec); tmp = (n > 0) ? nm_setting_wireless_security_get_pairwise (s_wsec, 0) : NULL; - if (n > 1 || !tmp || strcmp (tmp, "none")) { + if (n > 1 || g_strcmp0 (tmp, "none")) { g_set_error_literal (error, NM_SETTING_WIRELESS_SECURITY_ERROR, NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY, |