mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 05:50:12 +01:00
drmSL: Fix neighbor lookup
Commit e4a519635f:
Tidy up compile warnings by cleaning up types.
removed call to SLLocate which gutted the function of all functionality.
This patch restores the original behavior, with an additional fix
that zeros the update array in case SLLocate bails early.
v2: zero the update array instead of checking the return value.
SLLocate returns NULL both on failure and if the element is greater
than everything in the list
v3: Improve commit message
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
parent
bc6b5174d3
commit
3b2ee2b5bf
1 changed files with 4 additions and 2 deletions
|
|
@ -264,9 +264,11 @@ int drmSLLookupNeighbors(void *l, unsigned long key,
|
|||
unsigned long *next_key, void **next_value)
|
||||
{
|
||||
SkipListPtr list = (SkipListPtr)l;
|
||||
SLEntryPtr update[SL_MAX_LEVEL + 1];
|
||||
SLEntryPtr update[SL_MAX_LEVEL + 1] = {0};
|
||||
int retcode = 0;
|
||||
|
||||
SLLocate(list, key, update);
|
||||
|
||||
*prev_key = *next_key = key;
|
||||
*prev_value = *next_value = NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue