[PATCH] kexec-tools: Fix unused return value warning for fread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux