resource-manager: allocate resource id correctly 95/287795/2
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 6 Feb 2023 10:05:08 +0000 (19:05 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 6 Feb 2023 10:13:12 +0000 (19:13 +0900)
It hasn't cleared sign bit on allocating resource id. Fix it to clear
sign bit correctly.

Change-Id: Ic429dd26bcd6082ed434aecf98b8a48eb0b52b47
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/resource-manager/resource-manager.c

index b2f2fbf6c33857f7c889de4cbe374e9d5fa807a5..71d1a9de971a174df8302e6181d6f7dee263bde4 100644 (file)
@@ -83,8 +83,8 @@ static int alloc_resource_id(void)
        if (resource_id < 0)
                resource_id = init_resource_id();
 
-       ret = resource_id++;
-       clear_sign_bit(resource_id);
+       ret = resource_id;
+       resource_id = clear_sign_bit(resource_id + 1);
 
        pthread_mutex_unlock(&lock);