Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init: zephyr: Fix memory leak during secondary core init #9006

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static inline void lp_sram_unpack(void)

#ifndef __ZEPHYR__

static int check_restore(void)
static bool check_restore(void)
{
struct idc *idc = *idc_get();
struct task *task = *task_main_get();
Expand All @@ -100,10 +100,7 @@ static int check_restore(void)
* are available in memory, it means that this is not cold boot and memory
* has not been powered off.
*/
if (!idc || !task || !notifier || !schedulers)
return 0;

return 1;
return !!idc && !!task && !!notifier && !!schedulers;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyakh I could use the same function if I skipped checking the 'task' pointer.

}

static int secondary_core_restore(void)
Expand Down