mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 04:48:10 +02:00
platform: fix error handling for creating nlmsg in do_request_all_no_delayed_actions()
In practice, we don't fail to create the nlmsg, because in glib malloc() cannot fail and we always create large enough buffers. Anyway, handle the error correctly, and reduce the in-progress counter again.
This commit is contained in:
parent
106e4ebc13
commit
a4cff10ceb
1 changed files with 16 additions and 6 deletions
|
|
@ -5248,13 +5248,23 @@ do_request_all_no_delayed_actions (NMPlatform *platform, DelayedActionType actio
|
||||||
};
|
};
|
||||||
nle = nlmsg_append (nlmsg, &gmsg, sizeof (gmsg), NLMSG_ALIGNTO);
|
nle = nlmsg_append (nlmsg, &gmsg, sizeof (gmsg), NLMSG_ALIGNTO);
|
||||||
}
|
}
|
||||||
if (nle < 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (_nl_send_nlmsg (platform, nlmsg, NULL, NULL, DELAYED_ACTION_RESPONSE_TYPE_REFRESH_ALL_IN_PROGRESS, out_refresh_all_in_progress) < 0) {
|
if (nle < 0)
|
||||||
nm_assert (*out_refresh_all_in_progress > 0);
|
goto next_after_fail;
|
||||||
*out_refresh_all_in_progress -= 1;
|
|
||||||
}
|
if (_nl_send_nlmsg (platform,
|
||||||
|
nlmsg,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
DELAYED_ACTION_RESPONSE_TYPE_REFRESH_ALL_IN_PROGRESS,
|
||||||
|
out_refresh_all_in_progress) < 0)
|
||||||
|
goto next_after_fail;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
|
||||||
|
next_after_fail:
|
||||||
|
nm_assert (*out_refresh_all_in_progress > 0);
|
||||||
|
*out_refresh_all_in_progress -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue