diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c index 6f1f55fe3181..42c6609a1766 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -1643,7 +1643,7 @@ EXPORT_SYMBOL_GPL(kho_restore_free); */ bool is_kho_boot(void) { - return !!kho_get_fdt(); + return !!kho_in.fdt_phys; } EXPORT_SYMBOL_GPL(is_kho_boot); diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_session.c index f48e9a4185f9..74bc66929f4b 100644 --- a/kernel/liveupdate/luo_session.c +++ b/kernel/liveupdate/luo_session.c @@ -176,16 +176,6 @@ static int luo_session_insert(struct luo_session_header *sh, guard(rwsem_write)(&sh->rwsem); - /* - * For outgoing we should make sure there is room in serialization array - * for new session. - */ - if (sh == &luo_session_global.outgoing) { - err = kho_block_set_grow(&sh->block_set, sh->count + 1); - if (err) - return err; - } - /* * For small number of sessions this loop won't hurt performance * but if we ever start using a lot of sessions, this might @@ -196,6 +186,17 @@ static int luo_session_insert(struct luo_session_header *sh, if (!strncmp(it->name, session->name, sizeof(it->name))) return -EEXIST; } + + /* + * For outgoing we should make sure there is room in serialization array + * for new session. + */ + if (sh == &luo_session_global.outgoing) { + err = kho_block_set_grow(&sh->block_set, sh->count + 1); + if (err) + return err; + } + list_add_tail(&session->list, &sh->list); sh->count++;