Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3219321pxb; Mon, 18 Oct 2021 10:30:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUmpmZQA3NLjR9nYholNG5ffpVTkTfXEF830KjlM0HGzHrlmRTGbg8oTDJ7yY4/I8uAbMJ X-Received: by 2002:a05:6402:2684:: with SMTP id w4mr46127461edd.108.1634578233358; Mon, 18 Oct 2021 10:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634578233; cv=none; d=google.com; s=arc-20160816; b=0dvvKbWBlCvfpjMID7nJwLaiSObQdizSNbylCWE6dIA2NdhYVWIL9b7Nj+2WBEaRDm /U8gg0HdrB0d6LDSSXIM7wz19PvMLkVV12Bw2j+MFJXz8dhtNznjlo/4qhQz8efdQ9qY WjdCbp7VGLCWiKGzfeVYejnCXmQOukQQG+Jkej3JX+a+A6W436d+mBH6UfyxNjdEtcwj N3SC+3rH0pKJT6fMcaftTTdzDtt/zQktvHWLjbQmaZ0hyFVwqFbFlWEPMYBKlEu0b6/c +vwHdHdgHMfZQSbTW4eGV9nGRFIVnUJntckRfbbr7YKb/PYYy4MS7QpfRkQZw7tRoBXT aLOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=81EVcq6gCmuUBjFDCUIL/Fcgync/V07YYoweuxYtC3M=; b=MFinJByWUUyrugJH6j01VUJ+fVPPSXlnqs412cyn6/bYsdz8iBGBsjaI8wmdBJYz4z P+tDRD26f794uR/w5JGvTi8wyDIqbw+vKMSQF5FnBZhuTDNpbJM+2Orhj3SPNNFHxd+N Hs6gfGs0XBFfEGCUnaVdGF+SE7pApwU1ESwtnWx4cXMhEKkS7npQMbqC8GlgLOTnay2s L/eaq/THyhz1WzS2ukItRMyMCetfFQ3OgvvKp0wpPgjLos4kVTLaNb0pA/2VafsXW2PG fx/38ynqplNwE6waw72Ii5E8ZOAKdFB4ZQHNT52wEoJf+KYNiJICS2MR3TMGuihuuSpS p7nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kwDZFy2q; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si28881230edi.595.2021.10.18.10.29.58; Mon, 18 Oct 2021 10:30:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kwDZFy2q; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234132AbhJRRa5 (ORCPT + 99 others); Mon, 18 Oct 2021 13:30:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234125AbhJRRaz (ORCPT ); Mon, 18 Oct 2021 13:30:55 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 540E7C06161C for ; Mon, 18 Oct 2021 10:28:44 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id n11so11751865plf.4 for ; Mon, 18 Oct 2021 10:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=81EVcq6gCmuUBjFDCUIL/Fcgync/V07YYoweuxYtC3M=; b=kwDZFy2q/qzCtyTiwWw3Wuxm6xhtmgma7qLtq8KVxysZV0PPBcEjsIgKk4yw7uwonZ H84FEOuSEomf2yy5KCmkPkSv4P46qqV+hWQ0o5F9C0er8XDSnDYzXX+MZDGimdzP3tx0 LoFCC6ffqE3gxQwrWlMeCprXR8AgbGazhQ7Rxru95aR8qedvzyYbQCdOZcnlt+AAqdo7 xeCvyvk/j+4WxvCpJvi6hX8zPm/XVJq2CMRXiRgDazCdlHJzv1ig202epYdJBIJ/C12H 3yfBkZQiqegVjTY9tOejH+/mFdWl0aHDvvIZdhUkJJ9k5Huub5jbfPpwFdu6Kxf4RfZj lfxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=81EVcq6gCmuUBjFDCUIL/Fcgync/V07YYoweuxYtC3M=; b=c4eOhtRIiVcdtAPkZ/g7tTnHEfNHbunDJ7Ol31a31DT7Bg0u0WqriQgm+kRviiidxq lwIEwldDFwWauHGBgaB+DNslgpyLRAA6g1yHzXi3qAk1W7VXb5CgjBXG21rQfdo5dX7e hrMO9xOuEJx/QYu2SZUR3ujAyiOSdtZXcpwcTJf906h6V5ojYuw11c7CHFs6BCtqtAJX UPhOXcKFgY0Zcd41HZci/xgSBmEXDeZufzvdnVLg3rbkAHsGLZJpxScawGQHjNlGwLef UNdEa8yNIOab8v+2WbuPutWFyORlnVmri75oCAA63/HcvlXuOnUAGCzD+vYLDd2frAX1 yq1Q== X-Gm-Message-State: AOAM53073ZE/79uMVkjqUwPX33zobthIFy9Mq/UQFrLqlANApub8FgFA ZUmFsvyVHw80qIlYOmVTQKpAjAYc8duG0Q== X-Received: by 2002:a17:90b:4a92:: with SMTP id lp18mr227728pjb.47.1634578123651; Mon, 18 Oct 2021 10:28:43 -0700 (PDT) Received: from han1-NUC8i7BEH.hsd1.or.comcast.net ([2601:1c0:6a01:d830:a510:aebd:a4ae:453c]) by smtp.gmail.com with ESMTPSA id fv9sm51156pjb.26.2021.10.18.10.28.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 10:28:43 -0700 (PDT) From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH 6/9] profiles/input: Fix unchecked return value Date: Mon, 18 Oct 2021 10:28:30 -0700 Message-Id: <20211018172833.534191-7-hj.tedd.an@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211018172833.534191-1-hj.tedd.an@gmail.com> References: <20211018172833.534191-1-hj.tedd.an@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Tedd Ho-Jeong An This patch fixes the unchecked return value(CWE-252) issues reported by the Coverity. --- 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 50ae51855..013899211 100644 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -1050,7 +1050,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.25.1