From: Ameya Palande <ameya.palande@xxxxxxxxx> Signed-off-by: Ameya Palande <ameya.palande at nokia.com> --- kexec/arch/arm/kexec-zImage-arm.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c index 3bb49a7..72fcdd8 100644 --- a/kexec/arch/arm/kexec-zImage-arm.c +++ b/kexec/arch/arm/kexec-zImage-arm.c @@ -110,7 +110,11 @@ struct tag * atag_read_tags(void) return NULL; } - fread(buf, sizeof(buf[1]), BOOT_PARAMS_SIZE, fp); + if (!fread(buf, sizeof(buf[1]), BOOT_PARAMS_SIZE, fp)) { + fclose(fp); + return NULL; + } + if (ferror(fp)) { fprintf(stderr, "Cannot read %s: %s\n", fn, strerror(errno)); -- 1.6.3.3