lib: smf: check for NULL
don't execute share_paren() if the target is NULL in smf_execute_ancestor_exit_actions() Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This commit is contained in:
parent
9c05618c2b
commit
1ab6f82c7e
|
@ -172,7 +172,8 @@ __unused static bool smf_execute_ancestor_exit_actions(
|
||||||
for (const struct smf_state *tmp_state = ctx->current->parent;
|
for (const struct smf_state *tmp_state = ctx->current->parent;
|
||||||
tmp_state != NULL;
|
tmp_state != NULL;
|
||||||
tmp_state = tmp_state->parent) {
|
tmp_state = tmp_state->parent) {
|
||||||
if (!share_paren(target->parent, tmp_state) && tmp_state->exit) {
|
if ((target == NULL || !share_paren(target->parent, tmp_state)) &&
|
||||||
|
tmp_state->exit) {
|
||||||
tmp_state->exit(ctx);
|
tmp_state->exit(ctx);
|
||||||
|
|
||||||
/* No need to continue if terminate was set */
|
/* No need to continue if terminate was set */
|
||||||
|
|
Loading…
Reference in a new issue