diff mbox

opensm/complib/cl_ptr_vector.c: fix bug/compiler warning

Message ID 4B6828B6.5050005@dev.mellanox.co.il (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Yevgeny Kliteynik Feb. 2, 2010, 1:29 p.m. UTC
None
diff mbox

Patch

diff --git a/opensm/complib/cl_ptr_vector.c b/opensm/complib/cl_ptr_vector.c
index 8ccb9f0..36db4db 100644
--- a/opensm/complib/cl_ptr_vector.c
+++ b/opensm/complib/cl_ptr_vector.c
@@ -302,7 +302,8 @@  size_t cl_ptr_vector_find_from_end(IN const cl_ptr_vector_t * const p_vector,

 	while (i) {
 		/* Invoke the callback for the current element. */
-		if (pfn_callback(i, (void *)p_vector->p_ptr_array[--i],
+		i--;
+		if (pfn_callback(i, (void *)p_vector->p_ptr_array[i],
 				 (void *)context) == CL_SUCCESS) {
 			return (i);
 		}