summaryrefslogtreecommitdiff
path: root/kexec/arch/ppc64
diff options
context:
space:
mode:
authorDave Young <dyoung@redhat.com>2014-02-06 14:30:43 +0800
committerSimon Horman <horms@verge.net.au>2014-02-06 16:29:14 +0900
commiteb05abb060191940a0efc81e9fdce69aecd9e8b1 (patch)
treef3a4c998bf8e4d4862a828383a211d92be8ca1a5 /kexec/arch/ppc64
parent941fa1f6e31bc7cb1b014277de36b80425da7010 (diff)
zImage_ppc64_probe: return 0 instead of 1 in case of success
All other _probe functions return 0 for probing the kernel image successfully, so there's no reason to return 1 here. Fix it to return 0 instead. Signed-off-by: Dave Young <dyoung@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/ppc64')
-rw-r--r--kexec/arch/ppc64/kexec-zImage-ppc64.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kexec/arch/ppc64/kexec-zImage-ppc64.c b/kexec/arch/ppc64/kexec-zImage-ppc64.c
index 24a87c6..d084ee5 100644
--- a/kexec/arch/ppc64/kexec-zImage-ppc64.c
+++ b/kexec/arch/ppc64/kexec-zImage-ppc64.c
@@ -36,6 +36,7 @@
int zImage_ppc64_probe(FILE *file)
{
Elf32_Ehdr elf;
+ int valid;
if (fseek(file, 0, SEEK_SET) < 0) {
fprintf(stderr, "seek error: %s\n",
@@ -53,7 +54,7 @@ int zImage_ppc64_probe(FILE *file)
return -1;
}
- return (elf.e_ident[EI_MAG0] == ELFMAG0 &&
+ valid = (elf.e_ident[EI_MAG0] == ELFMAG0 &&
elf.e_ident[EI_MAG1] == ELFMAG1 &&
elf.e_ident[EI_MAG2] == ELFMAG2 &&
elf.e_ident[EI_MAG3] == ELFMAG3 &&
@@ -61,6 +62,8 @@ int zImage_ppc64_probe(FILE *file)
elf.e_ident[EI_DATA] == ELFDATA2MSB &&
elf.e_type == ET_EXEC &&
elf.e_machine == EM_PPC);
+
+ return valid ? 0 : -1;
}
int zImage_ppc64_load(FILE *file, int UNUSED(argc), char **UNUSED(argv),