diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index 53e8f3438..3bcefbc57 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -402,7 +402,7 @@ nm_setting_new_from_hash (GType setting_type, GHashTable *hash) continue; } - nm_g_object_set_property ((GObject *) setting, prop_name, src_value, NULL); + (void) nm_g_object_set_property ((GObject *) setting, prop_name, src_value, NULL); } g_type_class_unref (class); diff --git a/src/devices/bluetooth/nm-bluez5-manager.c b/src/devices/bluetooth/nm-bluez5-manager.c index 1649da248..8c93f2a50 100644 --- a/src/devices/bluetooth/nm-bluez5-manager.c +++ b/src/devices/bluetooth/nm-bluez5-manager.c @@ -380,12 +380,12 @@ object_manager_interfaces_added (GDBusProxy *proxy, if (g_variant_lookup (dict, NM_BLUEZ5_DEVICE_INTERFACE, "a{sv}", NULL)) device_added (proxy, path, self); if (g_variant_lookup (dict, NM_BLUEZ5_NETWORK_SERVER_INTERFACE, "a{sv}", NULL)) { - GVariant *adapter = g_variant_lookup_value (dict, NM_BLUEZ5_ADAPTER_INTERFACE, G_VARIANT_TYPE_DICTIONARY); + gs_unref_variant GVariant *adapter = g_variant_lookup_value (dict, NM_BLUEZ5_ADAPTER_INTERFACE, G_VARIANT_TYPE_DICTIONARY); const char *address; - g_variant_lookup (adapter, "Address", "&s", &address); - network_server_added (proxy, path, address, self); - g_variant_unref (adapter); + if ( adapter + && g_variant_lookup (adapter, "Address", "&s", &address)) + network_server_added (proxy, path, address, self); } } diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c index 3a289f533..6e5f10a06 100644 --- a/src/devices/wwan/nm-modem-broadband.c +++ b/src/devices/wwan/nm-modem-broadband.c @@ -894,7 +894,15 @@ static_stage3_ip4_done (NMModemBroadband *self) /* Missing gateway not a hard failure */ gw_string = mm_bearer_ip_config_get_gateway (self->_priv.ipv4_config); - nm_utils_parse_inaddr_bin (AF_INET, gw_string, &gw); + if ( !gw_string + || !nm_utils_parse_inaddr_bin (AF_INET, gw_string, &gw)) { + error = g_error_new (NM_DEVICE_ERROR, + NM_DEVICE_ERROR_INVALID_CONNECTION, + "(%s) retrieving IP4 configuration failed: invalid gateway address %s%s%s", + nm_modem_get_uid (NM_MODEM (self)), + NM_PRINT_FMT_QUOTE_STRING (gw_string)); + goto out; + } data_port = mm_bearer_get_interface (self->_priv.bearer); g_assert (data_port); diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index 4239c8982..6c72b8daf 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c @@ -2832,7 +2832,7 @@ nm_utils_fd_get_contents (int fd, gsize n_have, n_alloc; int fd2; - if (close_fd) + if (fd_keeper >= 0) fd2 = nm_steal_fd (&fd_keeper); else { fd2 = dup (fd); diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 79a0eb0b6..c4c93ed3f 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -3939,13 +3939,14 @@ do_request_link_no_delayed_actions (NMPlatform *platform, int ifindex, const cha { NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform); nm_auto_nlmsg struct nl_msg *nlmsg = NULL; + int nle; if (name && !name[0]) name = NULL; g_return_if_fail (ifindex > 0 || name); - _LOGD ("do-request-link: %d %s", ifindex, name ? name : ""); + _LOGD ("do-request-link: %d %s", ifindex, name ?: ""); if (ifindex > 0) { const NMDedupMultiEntry *entry; @@ -3965,8 +3966,15 @@ do_request_link_no_delayed_actions (NMPlatform *platform, int ifindex, const cha name, 0, 0); - if (nlmsg) - _nl_send_nlmsg (platform, nlmsg, NULL, DELAYED_ACTION_RESPONSE_TYPE_VOID, NULL); + if (nlmsg) { + nle = _nl_send_nlmsg (platform, nlmsg, NULL, DELAYED_ACTION_RESPONSE_TYPE_VOID, NULL); + if (nle < 0) { + _LOGE ("do-request-link: %d %s: failed sending netlink request \"%s\" (%d)", + ifindex, name ?: "", + nl_geterror (nle), -nle); + return; + } + } } static void diff --git a/src/settings/plugins/keyfile/nms-keyfile-writer.c b/src/settings/plugins/keyfile/nms-keyfile-writer.c index 1a68e5dc0..270a217e2 100644 --- a/src/settings/plugins/keyfile/nms-keyfile-writer.c +++ b/src/settings/plugins/keyfile/nms-keyfile-writer.c @@ -213,9 +213,8 @@ _internal_write_connection (NMConnection *connection, if (!data) return FALSE; - if (!g_file_test (keyfile_dir, G_FILE_TEST_IS_DIR)) - g_mkdir_with_parents (keyfile_dir, 0755); + (void) g_mkdir_with_parents (keyfile_dir, 0755); /* If we have existing file path, use it. Else generate one from * connection's ID.