DPDK Coverity issue 381631, 381646
cover DPDK Coverity issue 381631, 381646
Upstream fix to 23.03 for potential issue of dereferencing a pointer before null check.
Hernan Vargas (1):
baseband/acc: fix check after deref and dead code
drivers/baseband/acc/rte_acc100_pmd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Signature · 1 line
2.37.1
PATCH 1/1 baseband/acc: fix check after deref and dead code
Fix potential issue of dereferencing a pointer before null check. Remove null check for value that could never be null.
Coverity issue: 381646, 381631
--- drivers/baseband/acc/rte_acc100_pmd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/baseband/acc/rte_acc100_pmd.c +2 -5
@@ -4106,12 +4106,9 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,int ret, cbm;struct rte_bbdev_enc_op *op; -if (q ==NULL ) -return 0 ; -#ifdef RTE_LIBRTE_BBDEV_DEBUG -if (unlikely (ops ==0 )) +if (avail ==0 )return 0 ; -#endif + op =acc_op_tail (q,0 );if (unlikely (ops ==NULL || op ==NULL ))return 0 ;
Signature · 1 line
2.37.1
Re: [PATCH v1 1/1] baseband/acc: fix check after deref and dead code
Quoted 5 lines · Hernan Vargas
Fix potential issue of dereferencing a pointer before null check. Remove null check for value that could never be null.
Coverity issue: 381646, 381631
Fixes 989dec301a9 ("baseband/acc100: add ring companion address")
Please Cc stable, since it fixes a patch merged in v22.11.
Quoted 11 lines
Signed-off-by Hernan Vargas <[email protected]>--- drivers/baseband/acc/rte_acc100_pmd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)drivers/baseband/acc/rte_acc100_pmd.c +0
-0
drivers/baseband/acc/rte_acc100_pmd.c acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data, · line 4109
Quoted 8 lines
drivers/baseband/acc/rte_acc100_pmd.c +1
-4@@ -4106,12 +4106,9 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,int ret, cbm;struct rte_bbdev_enc_op *op; -if (q ==NULL ) -return 0 ; -#ifdef RTE_LIBRTE_BBDEV_DEBUG -if (unlikely (ops ==0 )) +if (avail ==0 )
Introduction of this new check on avail is not explained in the commit message, it does not seem related to the purpose of this patch.
It looks like an optimization, so should be in a separate patch.
Quoted 6 lines
drivers/baseband/acc/rte_acc100_pmd.c +1
-1return 0 ; -#endif + op =acc_op_tail (q,0 );if (unlikely (ops ==NULL || op ==NULL ))return 0 ;