All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm 1/4] drmSL: Fix neighbor printing
@ 2015-03-20 22:10 Jan Vesely
  2015-03-20 22:10 ` [PATCH libdrm 2/4] drmSL: Split tests to a separate file Jan Vesely
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Jan Vesely @ 2015-03-20 22:10 UTC (permalink / raw)
  To: dri-devel, Emil Velikov

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(-)

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;
-- 
2.1.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-03-26 14:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-20 22:10 [PATCH libdrm 1/4] drmSL: Fix neighbor printing Jan Vesely
2015-03-20 22:10 ` [PATCH libdrm 2/4] drmSL: Split tests to a separate file Jan Vesely
2015-03-22 15:18   ` Emil Velikov
2015-03-24 23:06     ` [PATCH libdrm 2/3] tests/drmsl: Extract tests out of xf86drmSL.c Jan Vesely
2015-03-26 14:49       ` Emil Velikov
2015-03-20 22:10 ` [PATCH libdrm 3/4] drmsltest: Check expected neighbours Jan Vesely
2015-03-20 22:10 ` [PATCH libdrm 4/4] drmSL: Remove test parts Jan Vesely
2015-03-22 15:22   ` Emil Velikov
2015-03-22 15:13 ` [PATCH libdrm 1/4] drmSL: Fix neighbor printing Emil Velikov
2015-03-24 23:16   ` [PATCH libdrm v3 1/3] drmSL: Fix neighbor lookup Jan Vesely
2015-03-26 14:53     ` Emil Velikov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.