New upstream version 16.11.4
[deb_dpdk.git] / lib / librte_eal / common / arch / arm / rte_cpuflags.c
index 23240ef..35338ef 100644 (file)
@@ -137,7 +137,7 @@ rte_cpu_get_features(hwcap_registers_t out)
        _Elfx_auxv_t auxv;
 
        auxv_fd = open("/proc/self/auxv", O_RDONLY);
-       assert(auxv_fd);
+       assert(auxv_fd != -1);
        while (read(auxv_fd, &auxv, sizeof(auxv)) == sizeof(auxv)) {
                if (auxv.a_type == AT_HWCAP) {
                        out[REG_HWCAP] = auxv.a_un.a_val;
@@ -148,6 +148,7 @@ rte_cpu_get_features(hwcap_registers_t out)
                                out[REG_PLATFORM] = 0x0001;
                }
        }
+       close(auxv_fd);
 }
 
 /*