Commit 8ac865f3 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

Fix check for open_image() ret

When open_image() was modified to return a pointer rather than an int
in commit 295090c1, these two checks were overlooked and never fixed.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@odin.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent b17962ad
...@@ -340,7 +340,7 @@ static int dump_ghost_file(int _fd, u32 id, const struct stat *st, dev_t phys_de ...@@ -340,7 +340,7 @@ static int dump_ghost_file(int _fd, u32 id, const struct stat *st, dev_t phys_de
pr_info("Dumping ghost file contents (id %#x)\n", id); pr_info("Dumping ghost file contents (id %#x)\n", id);
img = open_image(CR_FD_GHOST_FILE, O_DUMP, id); img = open_image(CR_FD_GHOST_FILE, O_DUMP, id);
if (img < 0) if (!img)
return -1; return -1;
gfe.uid = userns_uid(st->st_uid); gfe.uid = userns_uid(st->st_uid);
......
...@@ -2199,7 +2199,7 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid) ...@@ -2199,7 +2199,7 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
char root[PATH_MAX] = "."; char root[PATH_MAX] = ".";
img = open_image(CR_FD_MNTS, O_RSTR, nsid->id); img = open_image(CR_FD_MNTS, O_RSTR, nsid->id);
if (img < 0) if (!img)
return -1; return -1;
if (nsid->id != root_item->ids->mnt_ns_id) if (nsid->id != root_item->ids->mnt_ns_id)
......
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