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:
Thomas Haller 2019-02-20 14:53:27 +01:00
parent 106e4ebc13
commit a4cff10ceb

View file

@ -5248,13 +5248,23 @@ do_request_all_no_delayed_actions (NMPlatform *platform, DelayedActionType actio
};
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) {
nm_assert (*out_refresh_all_in_progress > 0);
*out_refresh_all_in_progress -= 1;
}
if (nle < 0)
goto next_after_fail;
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;
}
}