From 4cfd9197e124e3fdf28c4d2394febbc8fa657b8c Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Fri, 3 Oct 2014 14:42:00 +0400 Subject: [PATCH] cpuinfo: Fail if cpuinfo check is requested, but file is missing Signed-off-by: Pavel Emelyanov Acked-by: Cyrill Gorcunov --- arch/x86/cpu.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/x86/cpu.c b/arch/x86/cpu.c index 018f55115..3eeda7a02 100644 --- a/arch/x86/cpu.c +++ b/arch/x86/cpu.c @@ -319,12 +319,8 @@ int cpu_validate_cpuinfo(void) int ret = -1; img = open_image(CR_FD_CPUINFO, O_RSTR | O_OPT); - if (!img) { - if (errno == ENOENT) - return 0; - else - return -1; - } + if (!img) + return -1; if (pb_read_one(img, &img_cpu_info, PB_CPUINFO) < 0) goto err;