Commit eae09001 authored by Chun-Chieh Li's avatar Chun-Chieh Li Committed by Anas Nashif
Browse files

lib: smf: add NULL check in smf_execute_all_exit_actions



Like in smf_execute_all_entry_actions(), add NULL check
in smf_execute_all_exit_actions().

Signed-off-by: default avatarChun-Chieh Li <ccli8@nuvoton.com>
parent 09a6849a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -197,7 +197,8 @@ static bool smf_execute_all_exit_actions(struct smf_ctx *const ctx, const struct
{
	struct internal_ctx *const internal = (void *)&ctx->internal;

	for (const struct smf_state *to_execute = ctx->current; to_execute != topmost;
	for (const struct smf_state *to_execute = ctx->current;
	     to_execute != NULL && to_execute != topmost;
	     to_execute = to_execute->parent) {
		if (to_execute->exit) {
			to_execute->exit(ctx);