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 <krzysztofx.zdziarski@intel.com>
Patch co-authored by: Michal Gulbicki <michalx.gulbicki@intel.com>
Patch co-authored by: Julian Grajkowski <julianx.grajkowski@intel.com>
Patch co-authored by: Piotr Kasierski <piotrx.kasierski@intel.com>
Patch co-authored by: Lukasz Kolodzinski <lukaszx.kolodzinski@intel.com>
Patch co-authored by: Karol Grzadziel <karolx.grzadziel@intel.com>

Fixes:		a977168c48 ("qat: Add Intel® 4xxx Series platform support")
Reviewed by:	markj
Sponsored by:   Intel Corporation
Differential Revision: https://reviews.freebsd.org/D38339
This commit is contained in:
Krzysztof Zdziarski 2023-02-01 15:06:11 +00:00 committed by Mark Johnston
parent 6e5b082cab
commit c0a4a7bb94
3 changed files with 9 additions and 10 deletions

View File

@ -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);

View File

@ -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++)

View File

@ -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;