From 55b594527582351949e7bf57defbe4f5b534e145 Mon Sep 17 00:00:00 2001 From: Tedd Ho-Jeong An Date: Mon, 18 Oct 2021 10:28:30 -0700 Subject: [PATCH] profiles/input: Fix unchecked return value This patch fixes the unchecked return value(CWE-252) issues reported by the Coverity. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- profiles/input/device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/profiles/input/device.c b/profiles/input/device.c index 9a6f803..96e97be 100644 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -1056,7 +1056,11 @@ static int hidp_add_connection(struct input_device *idev) sprintf(handle, "0x%8.8X", idev->handle); key_file = g_key_file_new(); - g_key_file_load_from_file(key_file, filename, 0, NULL); + if (!g_key_file_load_from_file(key_file, filename, 0, &gerr)) { + error("Unable to load key file from %s: (%s)", filename, + gerr->message); + g_error_free(gerr); + } str = g_key_file_get_string(key_file, "ServiceRecords", handle, NULL); g_key_file_free(key_file); -- 2.7.4