power: fix data type of transition id 31/285731/1 accepted/tizen/7.0/unified/20221220.180247
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 15 Dec 2022 08:03:14 +0000 (17:03 +0900)
committeryoungjae cho <y0.cho@samsung.com>
Mon, 19 Dec 2022 06:02:50 +0000 (06:02 +0000)
Prevent including garbage at broadcast_transition_info() where an id
is extended to a 64-bit size datatype.

Change-Id: I5aabaecbb3a8dfa5a54aa7bd43248546e731bca6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 98289c214d9a610c009505639353bb49a8f69d65)

src/power/power.c

index 9bef87b..e225839 100644 (file)
@@ -45,7 +45,7 @@ static uint64_t current = DEVICED_POWER_STATE_START; /* current power state */
 static int max_wait_timeout = DEFAULT_MAX_WAIT_SECOND;
 static GQueue *transition_queue;
 static struct {
-       int id;
+       uint64_t id;
        int ongoing;
        struct trans_info ti;
        GList *waitings;
@@ -246,9 +246,9 @@ int confirm_change_state_wait(pid_t pid, guint64 id)
        return 0;
 }
 
-static int alloc_unique_id(void)
+static uint64_t alloc_unique_id(void)
 {
-       static int id = 0;
+       static uint64_t id = 0;
 
        return ++id;
 }