heart-cpu: Remove double unlock code 72/309772/1 accepted/tizen_unified accepted/tizen_unified_x accepted/tizen/unified/20240423.164616 accepted/tizen/unified/x/20240425.051106
authorUnsung Lee <unsung.lee@samsung.com>
Tue, 16 Apr 2024 10:17:09 +0000 (19:17 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Tue, 16 Apr 2024 10:22:16 +0000 (19:22 +0900)
Rmove double unlock code (i.e., unlock after unlock without getting lock).
It causes undefined behavior, so it must be removed.

This problem is reported by Coverity with id = 1750882.

Change-Id: Ia898cc02846d1cc2a9e0de9e363bfd37b0ca25a2
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-monitor/heart-cpu.c

index 9565d12..8f06914 100644 (file)
@@ -848,7 +848,7 @@ void heart_cpu_update(struct logging_table_form *data, void *user_data)
                ret = heart_cpu_save_to_file(cache);
                if (ret) {
                        _E("save to file failed");
-                       goto unlock_exit;
+                       return;
                }
 
                cache->last_file_commit_time = curr_time;