kunit_release_action(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

bestie, this is kunit_release_action from the Kernel API Manual β€” Run a matching action call immediately. πŸ’…

Okay so this is the function that says β€œactually, let’s do that deferred thing right now” instead of waiting for the test to wrap. ✨

✨ SYNOPSIS ✨

void kunit_release_action (struct kunit *test , kunit_action_t *action ,
void *ctx );

πŸ’… ARGUMENTS πŸ’…

  • test β€” Test case the action is associated with. 🫢
  • action β€” The deferred function to trigger. πŸ”₯
  • ctx β€” The context passed to the deferred function to trigger. πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

Execute a function deferred via kunit_add_action) immediately, rather than when the test ends. Yes bestie, trigger it now β€” no waiting for the end-of-test cleanup era. 🌸

If the function/context pair was deferred multiple times, it will only be executed once here. The most recent deferral will no longer execute when the test ends. That’s the whole vibe: one immediate run, and the latest queued repeat gets cancelled from the end-of-test lineup. πŸ’€

This line:

kunit_release_action(test, func, ctx);

is equivalent to:

func(ctx);
kunit_remove_action(test, func, ctx);

So it’s literally β€œcall the func, then remove the matching action” β€” iconic combo, no cap. πŸ‘‘

See also: devm_release_action for the devres equivalent. 🌈

🌈 SEE ALSO 🌈

The kernel file ./include/kunit/resource.h is the main character here, and these are all the linked faves:

xoxo bestie πŸ’– β€” this one comes from ./include/kunit and is dated October 2026 ✨

πŸ“¦ where this page comes from