Commit e18ae2a8 authored by Tikhomirov Pavel's avatar Tikhomirov Pavel Committed by Pavel Emelyanov

page-xfer: add proper initialization and deletion of xfer->parent

Signed-off-by: 's avatarTikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 2824c968
......@@ -557,6 +557,11 @@ static int write_pagehole_loc(struct page_xfer *xfer, struct iovec *iov)
static void close_page_xfer(struct page_xfer *xfer)
{
if (xfer->parent != NULL) {
xfer->parent->close(xfer->parent);
xfree(xfer->parent);
xfer->parent = NULL;
}
close(xfer->fd_pg);
close(xfer->fd);
}
......@@ -640,6 +645,8 @@ static int open_page_local_xfer(struct page_xfer *xfer, int fd_type, long id)
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment