The later netlink_call_async() call may fail. We should not touch the
return value when the function failed.
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
int r, k = 0;
+ Route *nr;
assert(link);
assert(link->manager);
return log_link_error_errno(link, r, "Could not append RTA_MULTIPATH attribute: %m");
if (ordered_set_isempty(route->multipath_routes)) {
- Route *nr;
-
k = route_add_and_setup_timer(link, route, NULL, &nr);
if (k < 0)
return k;
-
- if (ret)
- *ret = nr;
} else {
MultipathRoute *m;
link_ref(link);
+ if (ret)
+ *ret = nr;
+
return k;
}