diff mbox

[libdrm,1/4] drmSL: Fix neighbor printing

Message ID 1426889428-4847-1-git-send-email-jan.vesely@rutgers.edu (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Vesely March 20, 2015, 10:10 p.m. UTC
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

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
---
 xf86drmSL.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Emil Velikov March 22, 2015, 3:13 p.m. UTC | #1
On 20/03/15 22:10, Jan Vesely wrote:
> 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
> 
Can we add to the commit message what the issue is and mention the
commit which caused this regression ? With that

Acked-by: Emil Velikov <emil.l.velikov@gmail.com>

-Emil
diff mbox

Patch

diff --git a/xf86drmSL.c b/xf86drmSL.c
index acddb54..cf588ac 100644
--- a/xf86drmSL.c
+++ b/xf86drmSL.c
@@ -264,12 +264,14 @@  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;
-	
+
     if (update[0]) {
 	*prev_key   = update[0]->key;
 	*prev_value = update[0]->value;