]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/lock: more pieces return
authorVMware, Inc <>
Mon, 21 Nov 2011 22:54:02 +0000 (14:54 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 21 Nov 2011 22:54:02 +0000 (14:54 -0800)
More pieces go back in...

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/lock/ul.c

index 2d579e4789a7b54442b4362021be31dba246a73a..7d4565baaf1baed2ff26b3daeda72753a76b4188 100644 (file)
@@ -122,13 +122,11 @@ MXUserGetPerThread(void *tid,      // IN: thread ID
                    Bool mayAlloc)  // IN: alloc perThread if not present?
 {
    HashTable *hash;
-   MXUserPerThread *perThread;
+   MXUserPerThread *perThread = NULL;
 
    hash = HashTable_AllocOnce(&hashTableMem, 1024,
                               HASH_INT_KEY | HASH_FLAG_ATOMIC, NULL);
 
-   perThread = NULL;
-
    if (!HashTable_Lookup(hash, tid, (void **) &perThread)) {
       /* No entry for this tid was found, allocate one? */
 
@@ -291,9 +289,7 @@ MX_Rank
 MXUserCurrentRank(void)
 {
    MX_Rank maxRank;
-   MXUserPerThread *perThread; 
-
-   perThread = MXUserGetPerThread(MXUserGetThreadID(), FALSE);
+   MXUserPerThread *perThread = MXUserGetPerThread(MXUserGetThreadID(), FALSE);
 
    if (perThread == NULL) {
       maxRank = RANK_UNRANKED;