From patchwork Mon May 17 09:13:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Xu X-Patchwork-Id: 440268 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3246CC433B4 for ; Mon, 17 May 2021 08:16:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0192D610A1 for ; Mon, 17 May 2021 08:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235470AbhEQIR0 (ORCPT ); Mon, 17 May 2021 04:17:26 -0400 Received: from mga05.intel.com ([192.55.52.43]:28992 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232431AbhEQIRJ (ORCPT ); Mon, 17 May 2021 04:17:09 -0400 IronPort-SDR: 7C9oEapvNISFYpkMk/qeWie6RjK2ajP6f27jufWBhja1ZRCwCcaPAtoWaiohzUcG42z3FTN/ug PtuvXtdUuBbg== X-IronPort-AV: E=McAfee;i="6200,9189,9986"; a="285940870" X-IronPort-AV: E=Sophos;i="5.82,306,1613462400"; d="scan'208";a="285940870" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2021 01:15:53 -0700 IronPort-SDR: 7Wii9nsopgIQg6JXBKZjdAFSyr/D6eQCua+SWAKQm+TNJ25vYHFboQUXeJGR3trmHseL3q5S1P Fa25Asiy1EYA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,306,1613462400"; d="scan'208";a="410729299" Received: from qat-server-296.sh.intel.com ([10.67.117.159]) by orsmga002.jf.intel.com with ESMTP; 17 May 2021 01:15:52 -0700 From: Jack Xu To: herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com, Jack Xu , Zhehui Xiang , Giovanni Cabiddu Subject: [PATCH 4/5] crypto: qat - check return code of qat_hal_rd_rel_reg() Date: Mon, 17 May 2021 05:13:15 -0400 Message-Id: <20210517091316.69630-5-jack.xu@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517091316.69630-1-jack.xu@intel.com> References: <20210517091316.69630-1-jack.xu@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Check the return code of the function qat_hal_rd_rel_reg() and return it to the caller. This is to fix the following warning when compiling the driver with clang scan-build: drivers/crypto/qat/qat_common/qat_hal.c:1436:2: warning: 6th function call argument is an uninitialized value Signed-off-by: Jack Xu Co-developed-by: Zhehui Xiang Signed-off-by: Zhehui Xiang Reviewed-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/qat_hal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c index ed9b81347144..12ca6b8764aa 100644 --- a/drivers/crypto/qat/qat_common/qat_hal.c +++ b/drivers/crypto/qat/qat_common/qat_hal.c @@ -1417,7 +1417,11 @@ static int qat_hal_put_rel_wr_xfer(struct icp_qat_fw_loader_handle *handle, pr_err("QAT: bad xfrAddr=0x%x\n", xfr_addr); return -EINVAL; } - qat_hal_rd_rel_reg(handle, ae, ctx, ICP_GPB_REL, gprnum, &gprval); + status = qat_hal_rd_rel_reg(handle, ae, ctx, ICP_GPB_REL, gprnum, &gprval); + if (status) { + pr_err("QAT: failed to read register"); + return status; + } gpr_addr = qat_hal_get_reg_addr(ICP_GPB_REL, gprnum); data16low = 0xffff & data; data16hi = 0xffff & (data >> 0x10);