From: Danny Al-Gaaf Date: Sun, 26 Oct 2014 19:56:25 +0000 (+0100) Subject: arch/neon.c: check result of fread() X-Git-Tag: v0.88~22^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1cef8339f7a2a503327c20c014e696c91d36281e;p=ceph.git arch/neon.c: check result of fread() Fix for: CID 1128384 (#1 of 1): Ignoring number of bytes read (CHECKED_RETURN) check_return: fread(void * restrict, size_t, size_t, FILE * restrict) returns the number of bytes read, but it is ignored. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/arch/neon.c b/src/arch/neon.c index 32c1f621ef74..8baadedcc8d4 100644 --- a/src/arch/neon.c +++ b/src/arch/neon.c @@ -17,10 +17,13 @@ int ceph_arch_neon = 0; static unsigned long get_auxval(unsigned long type) { unsigned long result = 0; + int read = 0; FILE *f = fopen("/proc/self/auxv", "r"); if (f) { ElfW(auxv_t) entry; - while (fread(&entry, sizeof(entry), 1, f)) { + while ((read = fread(&entry, sizeof(entry), 1, f)) > 0) { + if (read != sizeof(entry)) + break; if (entry.a_type == type) { result = entry.a_un.a_val; break;