criu: pagemap: close pagemap image before returning from init_pagemaps

Submitted by Mike Rapoport on June 26, 2016, 5:56 a.m.

Details

Message ID 1466920594-8418-1-git-send-email-rppt@linux.vnet.ibm.com
State Accepted
Series "page-read: use in-memory PagemapEntry's"
Commit 5719fa4cdfb4b9f09bccd30478ff1ea9c150e73d
Headers show

Commit Message

Mike Rapoport June 26, 2016, 5:56 a.m.
Fix CID 163578 (#1 of 1): Structurally dead code (UNREACHABLE).
The pagemap image would never be closed because of stupid code order in
the original patch (674583f2: criu: page-read: read pagemaps at open time
and keep them in memory).
Fix that.

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

Patch hide | download patch | download mbox

diff --git a/criu/pagemap.c b/criu/pagemap.c
index 93eb999..08e3945 100644
--- a/criu/pagemap.c
+++ b/criu/pagemap.c
@@ -395,11 +395,11 @@  static int init_pagemaps(struct page_read *pr)
 		}
 	}
 
-	return 0;
-
 	close_image(pr->pmi);
 	pr->pmi = NULL;
 
+	return 0;
+
 free_pagemaps:
 	free_pagemaps(pr);
 	return -1;

Comments

Pavel Emelianov June 28, 2016, 1:04 p.m.
Applied