mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-21 11:52:34 +01:00
netconfig: Refactor rtnl error handling
Keep the rtnl destruction code in one place as it will have a few more usages in the future.
This commit is contained in:
parent
f1dd6b1084
commit
56670755c1
@ -604,24 +604,24 @@ static int netconfig_init(void)
|
|||||||
if (!r) {
|
if (!r) {
|
||||||
l_error("netconfig: Failed to register for RTNL link address"
|
l_error("netconfig: Failed to register for RTNL link address"
|
||||||
" notifications.");
|
" notifications.");
|
||||||
l_netlink_destroy(rtnl);
|
goto error;
|
||||||
rtnl = NULL;
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r = rtnl_ifaddr_get(rtnl, netconfig_ifaddr_cmd_cb, NULL, NULL);
|
r = rtnl_ifaddr_get(rtnl, netconfig_ifaddr_cmd_cb, NULL, NULL);
|
||||||
if (!r) {
|
if (!r) {
|
||||||
l_error("netconfig: Failed to get addresses from RTNL link.");
|
l_error("netconfig: Failed to get addresses from RTNL link.");
|
||||||
l_netlink_destroy(rtnl);
|
goto error;
|
||||||
rtnl = NULL;
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
netconfig_list = l_queue_new();
|
netconfig_list = l_queue_new();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
error:
|
||||||
|
l_netlink_destroy(rtnl);
|
||||||
|
rtnl = NULL;
|
||||||
|
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void netconfig_exit(void)
|
static void netconfig_exit(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user