diff --git a/page-xfer.c b/page-xfer.c index 2efbc5c93..f13b0ac1d 100644 --- a/page-xfer.c +++ b/page-xfer.c @@ -641,12 +641,11 @@ static int open_page_local_xfer(struct page_xfer *xfer, int fd_type, long id) * 2) when writing a hole, the respective place would be checked * to exist in parent (either pagemap or hole) */ - { + xfer->parent = NULL; + if (fd_type == CR_FD_PAGEMAP) { int ret; int pfd; - xfer->parent = NULL; - pfd = openat(get_service_fd(IMG_FD_OFF), CR_PARENT_LINK, O_RDONLY); if (pfd < 0 && errno == ENOENT) goto out;