diff mbox

[1/3] hostservices: Fix lid load

Message ID 20150219100811.23431.63894.stgit@thinktux.in.ibm.com
State Accepted
Headers show

Commit Message

Ananth N Mavinakayanahalli Feb. 19, 2015, 10:08 a.m. UTC
Fix the loop iterator to not miss a lid

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
---
 core/hostservices.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/core/hostservices.c b/core/hostservices.c
index ad19e15..1c41a95 100644
--- a/core/hostservices.c
+++ b/core/hostservices.c
@@ -452,6 +452,7 @@  void hservices_lid_preload(void)
 {
 	const uint32_t *lid_list = NULL;
 	size_t num_lids;
+	int i;
 
 	if (!hservice_runtime)
 		return;
@@ -465,8 +466,8 @@  void hservices_lid_preload(void)
 	prlog(PR_INFO, "HBRT: %d lids to load\n", (int)num_lids);
 
 	/* Currently HBRT needs only one (OCC) lid */
-	while (num_lids--)
-		__hservice_lid_preload(lid_list[num_lids]);
+	for (i = 0; i < num_lids; i++)
+		__hservice_lid_preload(lid_list[i]);
 }
 
 static int hservice_lid_load(uint32_t lid, void **buf, size_t *len)