From 8ac865f3ee57e9b2ef59d1a06cd5e05d577f0e23 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 1 May 2015 02:25:00 +0300 Subject: [PATCH] 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: Kir Kolyshkin Acked-by: Andrew Vagin Signed-off-by: Pavel Emelyanov --- files-reg.c | 2 +- mount.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files-reg.c b/files-reg.c index d7251ec30..2a6269b2a 100644 --- a/files-reg.c +++ b/files-reg.c @@ -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); img = open_image(CR_FD_GHOST_FILE, O_DUMP, id); - if (img < 0) + if (!img) return -1; gfe.uid = userns_uid(st->st_uid); diff --git a/mount.c b/mount.c index a78a48326..6dc48ebcd 100644 --- a/mount.c +++ b/mount.c @@ -2199,7 +2199,7 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid) char root[PATH_MAX] = "."; img = open_image(CR_FD_MNTS, O_RSTR, nsid->id); - if (img < 0) + if (!img) return -1; if (nsid->id != root_item->ids->mnt_ns_id)