event: Check return value from event_notify_null()

event_notify_null() returns int but its return value is not
checked in run_main_loop() and in fwu_mdata tests.
Add proper error checking to all unchecked call sites.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Michal Simek
2026-04-17 08:02:42 +02:00
committed by Heinrich Schuchardt
parent 57eae396ec
commit 583efb5040
2 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -569,11 +569,15 @@ static int dm_announce(void)
static int run_main_loop(void)
{
int ret;
#ifdef CONFIG_SANDBOX
sandbox_main_loop_init();
#endif
event_notify_null(EVT_MAIN_LOOP);
ret = event_notify_null(EVT_MAIN_LOOP);
if (ret)
return ret;
/* main_loop() can return to retry autoboot, if so just run it again */
for (;;)
+2 -2
View File
@@ -100,7 +100,7 @@ static int dm_test_fwu_mdata_read(struct unit_test_state *uts)
* Trigger lib/fwu_updates/fwu.c fwu_boottime_checks()
* to populate g_dev global pointer in that library.
*/
event_notify_null(EVT_MAIN_LOOP);
ut_assertok(event_notify_null(EVT_MAIN_LOOP));
ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev));
ut_assertok(fwu_init());
@@ -127,7 +127,7 @@ static int dm_test_fwu_mdata_write(struct unit_test_state *uts)
* Trigger lib/fwu_updates/fwu.c fwu_boottime_checks()
* to populate g_dev global pointer in that library.
*/
event_notify_null(EVT_MAIN_LOOP);
ut_assertok(event_notify_null(EVT_MAIN_LOOP));
ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev));