From nobody Wed Feb 01 16:02:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P6RWX0WvMz3cYfk; Wed, 1 Feb 2023 16:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P6RWX04pCz3Bpk; Wed, 1 Feb 2023 16:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675267336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sYGytH+f4tLgDN5cg8FcqKImo5nIzNUsoCbjiPietEQ=; b=ogF1Lns7JYxTHuEWEXB9aLZs3R/mkake/H/b9Km4u/vjyUGjidl99MDd+lWI4ICg87vpmQ c4DoaTrxkSmZybx5Kol5HOevcP7gmedvx1e5SEAgnisHKMxfmtkh6xv4aRIZMWR0PdMGXq 9pUNCtKdPGSpnvbWYrkYL4Yzy9pBx3ckgcYtye4dbNda/wqzGnDPsF/Gnpn6XroLJiaXFD OHOSpci/gx/rl/G27uRAfjtlx5v1PpPZ2DawEQdOVv3OhQn6SN2e6HJZnwD5aN905Qmwf7 kZC1P7CyUMx4U8QGvtlavNF6dGbmRyVqlhVRvksCNp5EylVkSHdg12o385fvow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675267336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sYGytH+f4tLgDN5cg8FcqKImo5nIzNUsoCbjiPietEQ=; b=sATZ9u8cL/V5b35bsTeCmgSWyOAPPELRgRvoyVlspSXN9kcip4+RLU8IP2WkplFpxF4ZDM L7oRJ9vpDA+b3qb9KYPIoP9Aw0wJ1XIuVuQuu4bY78kEZuTDQxNh3JCUUPhpYAHO/FXJUI NPS3hcJlnxOyEIGRl0OFPWo0y0csoumJV3IlgmHlH+FqYEGeUQ4WseS2VTy+oVGOWGtUop PT0fAq4SKbG7YOR/7sO0Iwz488r/j3amWeQpzLmvoEocotBt1opkTOnddJqSqDw3Ww3s6Q /idWMzDb/STiUkvq3KFez9VbkhNL2H1Jwc1CChz9QeB1XCfoj+nDKPP2FxdjAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675267336; a=rsa-sha256; cv=none; b=q61xd/3e34A9Kwy5B+RK6mbd7NZnvL618GZdDCGANsh/w2pM4VRZYscbs4WU5N6xwnNjdw uS0OQiIhYpUe92xotStDpURiyj5VBQSGStDmY3fuRuyyKfCwqgXxdpUksVOuC4xB6vVfH2 svVeoHjuuI4LAqd8A5AQiFnz+yEQbJeUMOz6+73HasrVbzrlJWF5fUsSmpknawJ8aq9ABf jCBxc8c2T8i2WRog2HbPHGGTxwYl8bWNH/eVu5txOquJ4gXX63FbLNjoUca51bMGpBhC7n 3AUNPe196LZwK3rApuTmNtOIhifms6bv8S0zTbmZTdNmeq35eZUQcoGPgIuuYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P6RWW6FvWzL7B; Wed, 1 Feb 2023 16:02:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 311G2FBa027950; Wed, 1 Feb 2023 16:02:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 311G2Fp5027949; Wed, 1 Feb 2023 16:02:15 GMT (envelope-from git) Date: Wed, 1 Feb 2023 16:02:15 GMT Message-Id: <202302011602.311G2Fp5027949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c0a4a7bb942f - main - qat: Fixed Coverity reported issue List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0a4a7bb942fd3302f0093e4353820916d3661d1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c0a4a7bb942fd3302f0093e4353820916d3661d1 commit c0a4a7bb942fd3302f0093e4353820916d3661d1 Author: Krzysztof Zdziarski AuthorDate: 2023-02-01 15:06:11 +0000 Commit: Mark Johnston CommitDate: 2023-02-01 16:02:08 +0000 qat: Fixed Coverity reported issue This patch provides fixes for following Coverity issues: CID 1504073 CID 1504075 CID 1504076 CID 1504077 Patch co-authored by: Krzysztof Zdziarski Patch co-authored by: Michal Gulbicki Patch co-authored by: Julian Grajkowski Patch co-authored by: Piotr Kasierski Patch co-authored by: Lukasz Kolodzinski Patch co-authored by: Karol Grzadziel Fixes: a977168c48d4 ("qat: Add IntelĀ® 4xxx Series platform support") Reviewed by: markj Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38339 --- sys/dev/qat/qat_api/common/compression/dc_datapath.c | 14 ++++++-------- sys/dev/qat/qat_common/adf_hw_arbiter.c | 3 ++- sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sys/dev/qat/qat_api/common/compression/dc_datapath.c b/sys/dev/qat/qat_api/common/compression/dc_datapath.c index 2e1f9ff96bd8..526954e15227 100644 --- a/sys/dev/qat/qat_api/common/compression/dc_datapath.c +++ b/sys/dev/qat/qat_api/common/compression/dc_datapath.c @@ -152,6 +152,7 @@ dcCompression_ProcessCallback(void *pRespMsg) if (NULL != pOpData) { verifyHwIntegrityCrcs = pOpData->verifyHwIntegrityCrcs; + integrityCrcCheck = pOpData->integrityCrcCheck; } hdrFlags = pCompRespMsg->comn_resp.hdr_flags; @@ -175,10 +176,9 @@ dcCompression_ProcessCallback(void *pRespMsg) (pService->pDcDpCb)(pResponse); } else { /* Free the memory pool */ - if (NULL != pCookie) { - Lac_MemPoolEntryFree(pCookie); - pCookie = NULL; - } + Lac_MemPoolEntryFree(pCookie); + pCookie = NULL; + if (NULL != pCbFunc) { pCbFunc(callbackTag, status); } @@ -432,10 +432,8 @@ dcCompression_ProcessCallback(void *pRespMsg) } /* Free the memory pool */ - if (NULL != pCookie) { - Lac_MemPoolEntryFree(pCookie); - pCookie = NULL; - } + Lac_MemPoolEntryFree(pCookie); + pCookie = NULL; if (NULL != pCbFunc) { pCbFunc(callbackTag, status); diff --git a/sys/dev/qat/qat_common/adf_hw_arbiter.c b/sys/dev/qat/qat_common/adf_hw_arbiter.c index e89a5f6ce68c..827d612e2c22 100644 --- a/sys/dev/qat/qat_common/adf_hw_arbiter.c +++ b/sys/dev/qat/qat_common/adf_hw_arbiter.c @@ -193,7 +193,7 @@ adf_exit_arb(struct adf_accel_dev *accel_dev) void adf_disable_arb(struct adf_accel_dev *accel_dev) { - struct adf_hw_csr_ops *csr_ops = GET_CSR_OPS(accel_dev); + struct adf_hw_csr_ops *csr_ops; struct resource *csr; unsigned int i; @@ -201,6 +201,7 @@ adf_disable_arb(struct adf_accel_dev *accel_dev) return; csr = accel_dev->transport->banks[0].csr_addr; + csr_ops = GET_CSR_OPS(accel_dev); /* Disable arbitration on all rings */ for (i = 0; i < GET_MAX_BANKS(accel_dev); i++) diff --git a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c index 1c8c9a2fda4c..002ea6d5d876 100644 --- a/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c +++ b/sys/dev/qat/qat_hw/qat_4xxx/adf_4xxx_hw_data.c @@ -747,7 +747,7 @@ static bool check_accel_unit_service(enum adf_accel_unit_services au_srv, enum adf_cfg_service_type ring_srv) { - if ((au_srv & ADF_ACCEL_SERVICE_NULL) && ring_srv == NA) + if ((ADF_ACCEL_SERVICE_NULL == au_srv) && ring_srv == NA) return true; if ((au_srv & ADF_ACCEL_COMPRESSION) && ring_srv == COMP) return true;