Blob Blame History Raw
From 35482a3eec708b45498b575d6bc5c6a556962acf Mon Sep 17 00:00:00 2001
Message-Id: <35482a3eec708b45498b575d6bc5c6a556962acf@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 15 Oct 2014 12:11:14 +0200
Subject: [PATCH] nodeGetFreePages: Push forgotten change

https://bugzilla.redhat.com/show_bug.cgi?id=1145048

In the previous patch I've changed the for loop bounds but forgot
to 'git add' changes that adapt the rest of the code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 4aa8a68faa86d6e1c6ecaeabcec487ee30eff813)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/nodeinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index dfde085..34d27a6 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -2045,7 +2045,7 @@ nodeGetFreePages(unsigned int npages,
         goto cleanup;
     }
 
-    lastCell = MIN(lastCell, startCell + cellCount);
+    lastCell = MIN(lastCell, startCell + (int) cellCount - 1);
 
     for (cell = startCell; cell <= lastCell; cell++) {
         for (i = 0; i < npages; i++) {
-- 
2.1.3