bm_listeners: Add and rename return value of bm_start_recording_event() 70/313970/6 accepted/tizen_unified_dev accepted/tizen_unified_toolchain accepted/tizen/9.0/unified/20241030.234750 accepted/tizen/unified/20240711.011519 accepted/tizen/unified/dev/20240711.085750 accepted/tizen/unified/toolchain/20240812.133413 accepted/tizen/unified/x/20240711.084635 accepted/tizen/unified/x/asan/20240813.231856 tizen_9.0_m2_release
authorUnsung Lee <unsung.lee@samsung.com>
Fri, 5 Jul 2024 08:43:56 +0000 (17:43 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Wed, 10 Jul 2024 05:13:54 +0000 (14:13 +0900)
Add error return values of bm_start_recording_event() and
rename return value 0 as BATTERY_MONITOR_ERROR_NONE of this function.

Change-Id: Ia620ea297b33b74e8a1cae9a2f3854707659df18
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/battery_dump/bm_listeners.c

index cb90d99c54a18ed149cfaea91753837eda4d51cb..7668ca269090399634125f4efbaa6b7db64cca86 100644 (file)
@@ -2454,11 +2454,21 @@ static int bm_start_recording_event()
        wakeup_hsp = 0; modem_hsp = 0; lock_ref_count = 0;
 
        app_list = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+       if (!app_list) {
+               _ERR("Failed to create app-list table");
+               return -EWOULDBLOCK;
+       }
 
        wakelock_list = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
+       if (!wakelock_list) {
+               _ERR("Failed to create wakelock-list table");
+               g_hash_table_destroy(app_list);
+               app_list = NULL;
+               return -EWOULDBLOCK;
+       }
 
        EXIT;
-       return 0;
+       return BATTERY_MONITOR_ERROR_NONE;
 }
 
 static int bm_stop_recording_event()