crypto/octeontx: fix null pointer dereferencing
The function otx_cpt_get_resource() would be setting the pointer 'instance'. In case of error, 'instance' would be set to NULL, and returns rte_errno. If rte_errno when 'instance' is set to NULL, it can lead to NULL pointer dereferencing. Coverity Issue: 323486, 323489 Fixes: bfe2ae495ee2 ("crypto/octeontx: add PMD skeleton") Fixes: 0961348fdf52 ("crypto/octeontx: add queue pair functions") Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
This commit is contained in:
parent
acbaf3cedc
commit
accf8ca7b0
@ -100,8 +100,8 @@ otx_cpt_pci_remove(struct rte_pci_device *pci_dev)
|
||||
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
|
||||
rte_free(cryptodev->data->dev_private);
|
||||
|
||||
cryptodev->device = NULL;
|
||||
cryptodev->device->driver = NULL;
|
||||
cryptodev->device = NULL;
|
||||
cryptodev->data = NULL;
|
||||
|
||||
/* free metapool memory */
|
||||
|
@ -216,7 +216,7 @@ otx_cpt_que_pair_setup(struct rte_cryptodev *dev,
|
||||
}
|
||||
|
||||
ret = otx_cpt_get_resource(cptvf, 0, &instance);
|
||||
if (ret != 0) {
|
||||
if (ret != 0 || instance == NULL) {
|
||||
CPT_LOG_ERR("Error getting instance handle from device %s : "
|
||||
"ret = %d", dev->data->name, ret);
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user