Skip to content

Commit 29639b9

Browse files
committed
Use the return value of rbtree_insert to silence a warning
The function prototype wants us to be warned when the result is not used, but it's not clear why - I assume to check for failure.
1 parent ee881cf commit 29639b9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ctr/ctr_linear.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,13 @@ void* linearMemAlign(size_t len, size_t alignment)
191191
sLinearPool.Deallocate(chunk);
192192
return nullptr;
193193
}
194-
if (rbtree_insert(&sAddrMap, &node->node));
194+
if (!rbtree_insert(&sAddrMap, &node->node)) {
195+
sLinearPool.Deallocate(chunk);
196+
return nullptr;
197+
}
195198

196-
if (sLinearPool_maxaddr < (u32)sLinearPool.last->base)
197-
sLinearPool_maxaddr = (u32)sLinearPool.last->base;
199+
if (sLinearPool_maxaddr < (u32)sLinearPool.last->base)
200+
sLinearPool_maxaddr = (u32)sLinearPool.last->base;
198201

199202
return chunk.addr;
200203
}

0 commit comments

Comments
 (0)