eal/ppc: fix file descriptor leak when getting CPU features
authorJianbo Liu <jianbo.liu@linaro.org>
Fri, 4 Nov 2016 09:46:43 +0000 (15:16 +0530)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 6 Nov 2016 21:42:06 +0000 (22:42 +0100)
Close the file descriptor after finish using it.

Fixes: 9ae15538 ("eal/ppc: cpu flag checks for IBM Power")

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Jan Viktorin <viktorin@rehivetech.com>
lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c

index a8147c8..fcf96e0 100644 (file)
@@ -116,6 +116,7 @@ rte_cpu_get_features(hwcap_registers_t out)
                else if (auxv.a_type == AT_HWCAP2)
                        out[REG_HWCAP2] = auxv.a_un.a_val;
        }
+       close(auxv_fd);
 }
 
 /*