[CRIU] [PATCH] criu: lazy-pages: don't modify variable used in a loop

Mike Rapoport rppt at linux.vnet.ibm.com
Thu Jun 16 02:02:00 PDT 2016


Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/uffd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/criu/uffd.c b/criu/uffd.c
index 988e311..46d9be4 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -729,10 +729,11 @@ static int handle_requests(int epollfd, struct epoll_event *events)
 		}
 
 		for (i = 0; i < ret; i++) {
+			int err;
 			lpi = uffd_to_lpi(events[i].data.fd);
 			BUG_ON(!lpi);
-			ret = handle_user_fault(lpi, dest);
-			if (ret < 0)
+			err = handle_user_fault(lpi, dest);
+			if (err < 0)
 				goto out;
 		}
 	}
-- 
1.9.1



More information about the CRIU mailing list