From cf730a96327f1e571d9e3621289a8dbd06c99cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B6ppner?= Date: Mon, 20 May 2019 16:35:10 +0200 Subject: [PATCH] zipl: Fix compile warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bootmap.c: In function ‘check_secure_boot_support’: bootmap.c:131:2: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result] fscanf(fp, "%d", &val); ^~~~~~~~~~~~~~~~~~~~~~ Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner --- zipl/src/bootmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zipl/src/bootmap.c b/zipl/src/bootmap.c index 456c2efe..3206b6d8 100644 --- a/zipl/src/bootmap.c +++ b/zipl/src/bootmap.c @@ -128,7 +128,10 @@ check_secure_boot_support(void) if (!fp) return false; - fscanf(fp, "%d", &val); + if (fscanf(fp, "%d", &val) != 1) { + fclose(fp); + return false; + } fclose(fp); return val ? true : false;